Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondbroplayz authored Dec 10, 2023
1 parent e2f5b5b commit 2c8b859
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ scene.background = spaceTexture;

// Avatar

const jeffTexture = new THREE.TextureLoader().load('dbp.png');
const dbpTexture = new THREE.TextureLoader().load('dbp.png');

const jeff = new THREE.Mesh(new THREE.BoxGeometry(3, 3, 3), new THREE.MeshBasicMaterial({ map: jeffTexture }));
const dbp = new THREE.Mesh(new THREE.BoxGeometry(3, 3, 3), new THREE.MeshBasicMaterial({ map: dbpTexture }));

scene.add(jeff);
scene.add(dbp);

// Moon

Expand All @@ -89,8 +89,8 @@ scene.add(moon);
moon.position.z = 30;
moon.position.setX(-10);

jeff.position.z = -5;
jeff.position.x = 2;
dbp.position.z = -5;
dbp.position.x = 2;

// Scroll Animation

Expand All @@ -100,8 +100,8 @@ function moveCamera() {
moon.rotation.y += 0.075;
moon.rotation.z += 0.05;

jeff.rotation.y += 0.01;
jeff.rotation.z += 0.01;
dbp.rotation.y += 0.01;
dbp.rotation.z += 0.01;

camera.position.z = t * -0.01;
camera.position.x = t * -0.0002;
Expand All @@ -127,4 +127,4 @@ function animate() {
renderer.render(scene, camera);
}

animate();
animate();

0 comments on commit 2c8b859

Please sign in to comment.