PDA

View Full Version : Easy question: state.light[n].position in fp



V-man
06-22-2003, 05:02 AM
The spec has a line that says this

state.light[n].position (x,y,z,w) light n position


but the position is in eye space? I'm guessing it is.

Asgard
06-22-2003, 08:15 AM
It's exactly the same value that you've set in your OpenGL program before with glLight(GL_POSITION, ...).
So it's in eye space, but in the eye space that was set at the time when glLight was called.

DanielHawson
06-22-2003, 08:37 AM
The light position is in whatever space you like, so long as when you specify the light position with glLight, you have the correct current modelview matrix to transform it into eye space.
I calculate a set of lights to use for each object in my scene, so my light positions are calculated in object space, with that objects modelview matrix loaded.

matt_weird
06-22-2003, 09:09 AM
Originally posted by DanielHawson:
with that objects modelview matrix loaded.

..and then every frame Matrix Reloaded -- so be careful, watch out for Deja Vu's http://www.opengl.org/discussion_boards/ubb/wink.gif

http://www.opengl.org/discussion_boards/ubb/biggrin.gif



[This message has been edited by matt_weird (edited 06-22-2003).]