gordon1
05-07-2007, 03:56 PM
hello,
The light is changing position when the camera moves.
Here is some code to give you an idea of what I'm doing.
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0,0,0, cameraDirection[0],cameraDirection[1],cameraDirection[2], 0,1,0);
glLightfv(GL_LIGHT1, GL_POSITION, lightPosition - cameraPosition);
render()
All objects render nicely in the scene, but the light source moves.
Can you tell me how to handle the glLight() function in this situation?
Thanks.
The light is changing position when the camera moves.
Here is some code to give you an idea of what I'm doing.
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0,0,0, cameraDirection[0],cameraDirection[1],cameraDirection[2], 0,1,0);
glLightfv(GL_LIGHT1, GL_POSITION, lightPosition - cameraPosition);
render()
All objects render nicely in the scene, but the light source moves.
Can you tell me how to handle the glLight() function in this situation?
Thanks.