|
26 | 26 | });
|
27 | 27 |
|
28 | 28 | drawCube(scene, material);
|
29 |
| - //drawPlane(scene, material); |
30 |
| - //drawSphere(scene, material); |
31 |
| - //drawCircle(scene, material); |
32 |
| - //drawCylinder(scene, material); |
33 |
| - //drawTetra(scene, material); |
34 |
| - //drawOcta(scene, material); |
35 |
| - //drawIcosa(scene, material); |
36 |
| - //drawTorus(scene, material); |
37 |
| - //drawTorusKnot(scene, material); |
| 29 | + // drawPlane(scene, material); |
| 30 | + // drawSphere(scene, material); |
| 31 | + // drawCircle(scene, material); |
| 32 | + // drawCylinder(scene, material); |
| 33 | + // drawTetra(scene, material); |
| 34 | + // drawOcta(scene, material); |
| 35 | + // drawIcosa(scene, material); |
| 36 | + // drawTorus(scene, material); |
| 37 | + // drawTorusKnot(scene, material); |
38 | 38 |
|
39 | 39 | // render
|
40 | 40 | renderer.render(scene, camera);
|
|
51 | 51 | }
|
52 | 52 |
|
53 | 53 | function drawSphere(scene, material) {
|
54 |
| - var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
55 |
| - Math.PI / 6, Math.PI / 3), material); |
56 |
| - //var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
57 |
| - // 0, Math.PI * 2, Math.PI / 6, Math.PI / 2), material); |
58 |
| - //var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
59 |
| - // Math.PI / 2, Math.PI, Math.PI / 6, Math.PI / 2), material); |
| 54 | + var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6), material); |
| 55 | + // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
| 56 | + // 0, Math.PI * 2, Math.PI / 6, Math.PI / 2), material); |
| 57 | + // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
| 58 | + // Math.PI / 2, Math.PI, Math.PI / 6, Math.PI / 2), material); |
| 59 | + // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
| 60 | + // Math.PI / 6, Math.PI / 3), material); |
| 61 | + // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
| 62 | + // 0, Math.PI * 2, Math.PI / 6, Math.PI / 3), material); |
| 63 | + // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 8, 6, |
| 64 | + // Math.PI / 2, Math.PI, Math.PI / 6, Math.PI / 2), material); |
60 | 65 | scene.add(sphere);
|
61 | 66 | }
|
62 | 67 |
|
|
67 | 72 |
|
68 | 73 | function drawCylinder(scene, material) {
|
69 | 74 | var cylinder = new THREE.Mesh(new THREE.CylinderGeometry(2, 2, 4, 18, 3), material);
|
70 |
| - //var cylinder = new THREE.Mesh(new THREE.CylinderGeometry(2, 3, 4, 18, 3), material); |
71 |
| - //var cylinder = new THREE.Mesh(new THREE.CylinderGeometry(2, 3, 4, 18, 3, true), material); |
| 75 | + // var cylinder = new THREE.Mesh(new THREE.CylinderGeometry(2, 3, 4, 18, 3), material); |
| 76 | + // var cylinder = new THREE.Mesh(new THREE.CylinderGeometry(2, 3, 4, 18, 3, true), material); |
72 | 77 | scene.add(cylinder);
|
73 | 78 | }
|
74 | 79 |
|
|
88 | 93 | }
|
89 | 94 |
|
90 | 95 | function drawTorus(scene, material) {
|
91 |
| - var torus = new THREE.Mesh(new THREE.TorusGeometry(3, 1, 4, 8, Math.PI / 3 * 2), material); |
| 96 | + var torus = new THREE.Mesh(new THREE.TorusGeometry(3, 1, 4, 8), material); |
| 97 | + // var torus = new THREE.Mesh(new THREE.TorusGeometry(3, 1, 12, 18), material); |
| 98 | + // var torus = new THREE.Mesh(new THREE.TorusGeometry(3, 1, 4, 8, Math.PI / 3 * 2), material); |
92 | 99 | scene.add(torus);
|
93 | 100 | }
|
94 | 101 |
|
|
106 | 113 | // x-axis
|
107 | 114 | var xGeo = new THREE.Geometry();
|
108 | 115 | xGeo.vertices.push(new THREE.Vector3(0, 0, 0));
|
109 |
| - xGeo.vertices.push(new THREE.Vector3(1, 0, 0)); |
| 116 | + xGeo.vertices.push(new THREE.Vector3(3, 0, 0)); |
110 | 117 | var xMat = new THREE.LineBasicMaterial({
|
111 | 118 | color: 0xff0000
|
112 | 119 | });
|
|
116 | 123 | // y-axis
|
117 | 124 | var yGeo = new THREE.Geometry();
|
118 | 125 | yGeo.vertices.push(new THREE.Vector3(0, 0, 0));
|
119 |
| - yGeo.vertices.push(new THREE.Vector3(0, 1, 0)); |
| 126 | + yGeo.vertices.push(new THREE.Vector3(0, 3, 0)); |
120 | 127 | var yMat = new THREE.LineBasicMaterial({
|
121 | 128 | color: 0x00ff00
|
122 | 129 | });
|
|
126 | 133 | // z-axis
|
127 | 134 | var zGeo = new THREE.Geometry();
|
128 | 135 | zGeo.vertices.push(new THREE.Vector3(0, 0, 0));
|
129 |
| - zGeo.vertices.push(new THREE.Vector3(0, 0, 1)); |
| 136 | + zGeo.vertices.push(new THREE.Vector3(0, 0, 3)); |
130 | 137 | var zMat = new THREE.LineBasicMaterial({
|
131 | 138 | color: 0x00ccff
|
132 | 139 | });
|
|
0 commit comments