Skip to content

Instantly share code, notes, and snippets.

@tomlagier
Created January 19, 2016 19:09
Show Gist options
  • Save tomlagier/6dea70258480f5765d80 to your computer and use it in GitHub Desktop.
Save tomlagier/6dea70258480f5765d80 to your computer and use it in GitHub Desktop.
constructor() {
this.lights = {
ambientLight: new THREE.AmbientLight(0x909090),
spotLight: new THREE.SpotLight(0xffffff, 1, 0, 0.4),
directlight: new THREE.DirectionalLight(0xEEEEEE)
};
this.setupLightPositions();
}
setupLightPositions(){
this.lights.directlight.target.position.set(0, 0, 0);
let spotlight = this.lights.spotLight;
spotlight.position.set(0, 7, 0);
spotlight.target.position.set(0, 0, 0);
spotlight.castShadow = true;
spotlight.shadowCameraFar = 21.1;
spotlight.shadowCameraNear = 1;
spotlight.shadowCameraFov = 10;
ThreeHub.scene.add(new THREE.SpotLightHelper(spotlight));
}
//All lights get added to scene later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment