Skip to content

Instantly share code, notes, and snippets.

@RxET
Last active March 20, 2018 03:33
Show Gist options
  • Save RxET/156f874fbcdf861c3a643d0c7b556494 to your computer and use it in GitHub Desktop.
Save RxET/156f874fbcdf861c3a643d0c7b556494 to your computer and use it in GitHub Desktop.
Three.js or There’s a hypercube in my timeline and I can’t get out
function createBox() {
//create the box geometry
var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 );
//create the material, this one is purple and affected by lights
var boxMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff } )
//smash them together in a mesh, and add to your scene
box = new THREE.Mesh(boxGeometry, boxMaterial);
scene.add(box);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment