lightning

Im learning how to use lights, but i have a problem, The lighting looks to be ok, but when I rotate (using quaternions) the light position changes, (I dont know if its the position or the intensity).

Can you hhelp me?

thanks,

When you define light position (using glLight function) it is multiplied by modelview matrix just as it would be a point or vertex. Check out : http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/light.html

Try this:

glPushMatrix();
glRotatef(theta, 1, 1, 1);
DrawTheObjectYouWantToRotate();
glPopMatrix();