Static light positions in scene


I would like to have a light attached to the Camera so that it does not rotate when I rotate the whole scene through THREE.TrackballControls.

I am setting up lights like this:

var light = new THREE.DirectionalLight( 0xFFFFFF, 1 );
light.position.set( -0.65, 0.59, 0.48 ).normalize();
scene.add( light );

I think the problem is because lights are binded to the scene. In OpenGL I could set them with an identity modelView matrix and have them fixed but not really sure how to do this with three.js. Has anybody had this problem before?


Author: Fantashit

1 thought on “Static light positions in scene

  1. You can add the light to the camera with camera.add( light ). Then the light’s position is relative to the camera’s

Comments are closed.