yskang

threejs-get-started-3

Apr 15th, 2020
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Prepare stage scene 
  2. const scene = new THREE.Scene();
  3.  
  4. // Add actors of this scene
  5. const geometry = new THREE.BoxGeometry( 1, 1, 1 );
  6. const material = new THREE.MeshPhongMaterial( { color: 0x0000ff } );
  7.  
  8. const cube = new THREE.Mesh( geometry, material );
  9. cube.position.set( 0, 0, 0 );
  10.  
  11. scene.add( cube );
Advertisement
Add Comment
Please, Sign In to add comment