Skip to content

Instantly share code, notes, and snippets.

@RxET
Last active March 20, 2018 03:34
Show Gist options
  • Save RxET/edd22f2c88289c3d7e6b078350c657ff to your computer and use it in GitHub Desktop.
Save RxET/edd22f2c88289c3d7e6b078350c657ff 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 letThereBeLight() {
//create your light - this one is white at almost full intensity
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.9 );
// set the light direction
directionalLight.position.set(150, 350, 350);
//let it cast shadows
directionalLight.castShadow = true;
// and add it to the scene
scene.add( directionalLight );
controls = new THREE.OrbitControls(camera, renderer.domElement)
animate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment