PDA

View Full Version : Specular Reflectance



05-21-2001, 02:36 PM
I'm creating a 3D maze and I'm having some problems with specular reflectance. I provided shininess and specular factors for everything. I have a rotatable view. ie. I call gluLookAt() every time I'm moving my camera, but the specular reflectance doesn't move with my position. It always stays at the point it started at, with the highlight showing in the exact same place no matter where I move my camera. It's as if OpenGL isn't registering the movement of the eye properly.

Anybody have any prior experience with this kind of thing?

Korval
05-21-2001, 06:20 PM
Before you call gluLookAt, did you remember to call glMatrixMode(GL_MODELVIEW_MATRIX)? Lighting takes place between the Modelview and projection matrix transforms. Obviously, for diffuse lighting and regular transformation it wouldn't matter. But, for specular lighting, it makes all the difference.

MrShoe
05-22-2001, 02:39 AM
Bah, sorry to nitpick, but isnt that
glMatrixMode(GL_MODELVIEW)??
Anyway, just a minor detail.