three.js directional light following camera

javascript, three.js

Solution

Some of the Object3D properties have become immutable in r68, so copying to .position directly won't work anymore. Instead you need to use the various methods on these properties:

light.position.copy( camera.position );

I've not used these lights myself, but from the documentation I gather that they aren't supposed to automatically follow anything. Also, the position is irrelevant since they act like they're an infinite distance away; only the rotation matters.

Problem

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.

Original source