# Orbit Controls DirectionalLight follow camera, but at a distance

I’m using orbit Controls to move the camera around the scene. I have added a directional light which i am always positioning where the camera is, so i don’t have faces of my object in eternal shadow.
this is how i’m doing it:

``````function render() {
followLight.position.copy(camera.position );
renderer.render( scene, camera );
}
``````

Now what I’d like is to have the light follow the camera at a fixed distance on the same path as the camera is moving, so I get an angle out of the shadows.

I’ve tried this:

``````function render() {
followLight.position.copy(camera.position );
followLight.position.x+=0.5;
followLight.position.y+=0.5;
followLight.position.z+=0.5;
renderer.render( scene, camera );
}
``````

Simply adding a constant to x, y, z position of the camera does not do the trick as it seems a more complex formula is needed (i imagine at some point the x,y,z, values of the camera get negative values, something along a sine function perhaps, i’ve no clue).

I’ve always hated math but now it has come back and it bites my behind.

Can anyone share a method to accomplish what I seek?

Instead of copying the camera’s position over and over again, you might want to add the light as a children of your camera like so:

``````camera.add( followLight );
``````

If you then configure a position for the light source, it will be always relative to its parent (the camera).

Thank you, that does it.