PDA

View Full Version : gl lighting and camera rotation



ariock
03-28-2004, 11:41 PM
Hi, can somebody help me with some strange light rotation problem:
I have an openGl display where I draw a sphere with pre-calculated normals. Then with the mouse, I rotate the sphere.
The drawing code doesn't rotate the full object, but instead use a glRotate to position the camera.
The problem is that my light-patch (impact of the light on ma sphere) just rotate as the ball instead of staying in front of me (light is position at the same place as the user view-point)
I tried rotating my lights with the same matrix as the sphere, but this makes things even stranger:
when rotating from left to right the patch stay in front of me, but when rotating from top to down, the path rotate with the sphere?! Can somebody give me a hint?