threejs cube mesh 1

threejs cube mesh

const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );

Here is what the above code is Doing:
1. Create a scene
2. Create a camera
3. Create a renderer
4. Create a cube
5. Add the cube to the scene
6. Render the scene

Similar Posts