Hello,
I have a problem with my OpenGL lighting.
I use gluPerspective() and gluLookAt() to position my camera. Then I position my light. When I move and rotate the camera, the light basically works well while it is in front of the image plane. When I move the camera so that the relative light position exceeds the interval of ±90 degrees from the viewing direction, it appears to change its position to somewhere entirely different (I don’t know where, probably quite far away, as I only see specular and ambient effects but no diffusion). Or, in other words, if the light position is behind the image plane, it switches its position.
I’m not using unsigned floats anywhere and the light position appears to work fine as long as it’s in front of the image plane.
On a different note, I’m also confused by the fact that I’m observing specular effects at all, as I’ve initialized the light with:
specularLight[0] = specularLight[1] = specularLight[2] = 0.0f; specularLight[3] = 1.0f;
This however is a minor problem if at all.
I’m using GL_LIGHT0 exclusively, the OS is Windows XP, the IDE is Dev C++, graphics card is GeForce 9300M GS, OpenGL version 2.1.
Any help would be most appreciated.
Thanks for your time,
Jay
Edit: I would also like to point out that I did some web searching on this topic, but the keywords that I would associate with this problem didn’t yield any related results.