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

Function makeInstance

assets/js/3DPaint.js:32–41  ·  view source on GitHub ↗
(geometry, color, x, y, z)

Source from the content-addressed store, hash-verified

30 base.scale.set(0.1, 0.1, 0.1);
31
32 function makeInstance(geometry, color, x, y, z) {
33 const material = new THREE.MeshPhongMaterial({ color });
34
35 const cube = new THREE.Mesh(geometry, material);
36 base.add(cube);
37
38 cube.position.set(x, y, z);
39
40 return cube;
41 }
42
43 makeInstance(geometry, "#0FF", -2, 0, 0);
44 makeInstance(geometry, "#0F0", 2, 0, 0);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected