Last active
March 20, 2018 03:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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