View Full Version : why the highlight spot of a sphere doesn't change while i'm moving camera?

06-01-2013, 03:00 AM

after (camera moved to the right side of the room):
https://7y6xpa.sn2.livefilestore.com/y2p3RN3TUeYr8trHqYi19r6HkrnbyEDB08TwMJzOrALMU_CzlY kfOQeipq3Cx-IzqNUbVNA8f_obxhIO-RbWViBFgDjunhzod3IdzkkhCnOZI4S9oIAt8hzCMpThpC1RxE0/QQ%E6%88%AA%E5%9B%BE20130601175302.png?psid=1

The position of the lights didn't change while the camera is moving (In fact, the white ball and the red cone represent where the lights are).

The highlight spot of the sphere (circled) is really strange. I thought the spot would change when I looked at it at a different position (changing the camera), because it's Specular Reflection! But it just didn't.

I checked my code and found nothing. Can anyone please give some tips?

06-01-2013, 03:51 AM
Well, I now know what happened. I use glLookAt while glMatrixMode(GL_PROJECTION)!
Let me get this straight:
after (fixed):

so, gluLookAt cannot be used under projection matrix!
But now I don't quite understand while the wrong was like that. Though it was wrong, When I set "gluLookAt", the camera position did changed! Why just the highlight spot turned out like that?

06-01-2013, 07:21 PM
read this http://www.songho.ca/opengl/gl_transform.html to understand how the matrices work