Odd problem with lights

Hi guys,

I’m beginning in OpenGL, and I’ve done a simple display program using glut, in which you can freely move.

But the problem is that when I turn, the lights seem to turn with me, so the lighting becomes bad.

To get an idea : http://prekipik.free.fr/gluttest.zip
then ‘make glut’, then try to turn using ‘7’ and ‘9’ on the numeric keypad.

Thank you.

You need to set light position after you set the modelview matrix. This is because that the light position is multiplied with the modelview matrix. You probably set the position at startup or so.

Well, it works perfectly.
Thank you very much for your help.