PDA

View Full Version : lightning



lsdi
02-23-2002, 08:44 PM
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,

Spartacus
02-24-2002, 02:06 AM
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

Questions Burner
02-25-2002, 10:41 AM
Try this:

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