My light seems to be following my cameras movment....

i have a ogl program that generates fractal terrian… so i set up my camera to move around the landscape… i decided that it would look better with some lighting and it does. however now when i move the camera around it seems as if the light is moving with the camera…

could this have somthing to do with wich projection matrix i have set when i call glulookat ? what matric should i have set when i call that?

any help/suggestions would be much appreciated. thanks

remember lights are moved with along with everything else with the modelview matrix…

try doing lights
moving cam
drawing scene

The problem is that you’re setting you’re light up in globle coordinates. Set the position of the lights in object space and the light won’t move.

To do this just set the position of the light when you get to the glPush/pull Matrix pair for you’re object.