Archived

This topic is now archived and is closed to further replies.

gluLookAt + lighting

This topic is 5127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a simple app right now that has 1 light (all default values) a normalized cube, and I am moving about the scene with gluLookAt. The problem is that the light seems to move along with my gluLookAt command similar to a flashlight, so no matter what part of the cube I look at it is always most bright when it is in the center of my view. What I want to be able to do is move behind the cube, and see the dark side of it. Has anyone had this problem before? I dont have the code with me right now but here is the basic procedure I use: 1. Init OpenGL + Window 2. Init OpenGL Options (culling, depth test, lighting) Then in my render loop 1. Clear (Color + Depth) 2. LoadIdentity 3. Position and rotate the camera 4. Call gluLookAt 5. Draw Cube Thank you. PS. I started with the Java Port of Nehe''s First Tutorial.

Share this post


Link to post
Share on other sites
I think it''s because when you do your glTranslates and glRotates and whatever, it''s actually moving where it draws the objects, not where the camera is. So, the camera is staying still and everything (your cube) is moving around it. So, what you probably would have to do is move your light whenever you move your scene. Otherwise the light is just staying in the same spot.

It could be that I have no clue what I''m talking about, but I think that''s what''s happening...

Share this post


Link to post
Share on other sites