I having a problem with Three.js and lighting following a camera.
I am using orbit control for the mouse movement/
In release number 66 the following use to work
light = new THREE.DirectionalLight( 0xffffff, 1 );
light.position = camera.position;
scene.add(light);
However in release number 67 and 68 the lighting doesn't follow the camera. The light is only show on one face.
I got it to work with the help of above
controls = new THREE.OrbitControls(camera);
controls.addEventListener( 'change', light_update );
function light_update()
{
light.position.copy( camera.position );
}
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With