(geometry, color, x)
| 32 | const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth); |
| 33 | |
| 34 | function makeInstance(geometry, color, x) { |
| 35 | const material = new THREE.MeshPhongMaterial({ color }); |
| 36 | |
| 37 | const cube = new THREE.Mesh(geometry, material); |
| 38 | scene.add(cube); |
| 39 | |
| 40 | cube.position.x = x; |
| 41 | |
| 42 | return cube; |
| 43 | } |
| 44 | |
| 45 | const cubes = [makeInstance(geometry, 0x44aa88, 0)]; |
| 46 |