MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / makeInstance

Function makeInstance

assets/js/3DCubeMap.js:34–43  ·  view source on GitHub ↗
(geometry, color, x)

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected