Skip to content

Commit

Permalink
update the example code
Browse files Browse the repository at this point in the history
  • Loading branch information
MOQN committed Oct 6, 2024
1 parent de63b21 commit 9786b10
Show file tree
Hide file tree
Showing 35 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let cube;

function setupThree() {
cube = getBox();
scene.add(cube); // don't forget to add to scene
cube.position.set(1, 0, 0); //(x, y, z);
cube.scale.x = 100;
cube.scale.y = 100;
Expand Down Expand Up @@ -54,7 +55,5 @@ function getBox() {
color: 0xffffff,
});
mesh = new THREE.Mesh(geometry, material);
scene.add(mesh); // *** reorganize ***

return mesh;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let cube;

function setupThree() {
cube = getBox();
scene.add(cube); // don't forget to add to scene
cube.position.set(1, 0, 0); //(x, y, z);
cube.scale.x = 100;
cube.scale.y = 100;
Expand Down Expand Up @@ -58,7 +59,5 @@ function getBox() {
color: 0xffffff,
});
mesh = new THREE.Mesh(geometry, material);
scene.add(mesh); // *** reorganize ***

return mesh;
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function getBox() {
//wireframe: true
});
let mesh = new THREE.Mesh(geometry, material);
scene.add(mesh); // *** reorganize ***
return mesh;
}

Expand All @@ -124,6 +123,7 @@ class Cube {
this.isDone = false;
//
this.mesh = getBox();
scene.add(this.mesh); // don't forget to add to scene
}
setPosition(x, y, z) {
this.pos = createVector(x, y, z);
Expand Down

0 comments on commit 9786b10

Please sign in to comment.