Skip to content

Commit aec8922

Browse files
committed
Chapter 1 change cube to plane
1 parent f3da181 commit aec8922

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Chapter1/1.1.1.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@
2020
var material = new THREE.MeshBasicMaterial({
2121
color: 0xffffff // white
2222
});
23-
// cube
24-
var cubeGeo = new THREE.Geometry();
25-
cubeGeo.vertices = [new THREE.Vector3(1.8, 0.8, 0),
26-
new THREE.Vector3(1.8, -0.8, 0), new THREE.Vector3(0.2, -0.8, 0),
27-
new THREE.Vector3(0.2, 0.8, 0)];
28-
cubeGeo.faces.push(new THREE.Face3(0, 2, 1), new THREE.Face3(0, 3, 2));
29-
var cube = new THREE.Mesh(cubeGeo, material);
30-
scene.add(cube);
23+
// plane
24+
var planeGeo = new THREE.PlaneGeometry(1.5, 1.5);
25+
var plane = new THREE.Mesh(planeGeo, material);
26+
plane.position.x = 1;
27+
scene.add(plane);
3128

3229
// triangle
3330
var triGeo = new THREE.Geometry();

0 commit comments

Comments
 (0)