MCPcopy Create free account
hub / github.com/SuboptimalEng/three-js-tutorials / addNewBoxMesh

Function addNewBoxMesh

09-raycaster/src/App.jsx:20–28  ·  view source on GitHub ↗
(x, y, z)

Source from the content-addressed store, hash-verified

18 // test.scene.add(boxMesh);
19
20 const addNewBoxMesh = (x, y, z) => {
21 const boxGeometry = new THREE.BoxGeometry(1, 1, 1);
22 const boxMaterial = new THREE.MeshPhongMaterial({
23 color: 0xfafafa,
24 });
25 const boxMesh = new THREE.Mesh(boxGeometry, boxMaterial);
26 boxMesh.position.set(x, y, z);
27 test.scene.add(boxMesh);
28 };
29
30 // top rows
31 addNewBoxMesh(0, 2, 0);

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected