Archived

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

curious about glTranslatef...

This topic is 5958 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

Well, im just wondering, glTranslateF just moves teh position of where the graphics are drawn, correct? It doesnt actually affect where the ''camera'' is positioned? Well, anywho, on NeHe''s tutorial 10, you move around with glTranslatef...so what this is doing is just moving the ''level'' and the camera always stays at the same place, but it gives teh affect of the camera moving, is this correct? Also, I was just looking at some openGL commands, and I came across gluLookAt. Now it seems this would be faster because it actually moves the camera around instead of redrawing the ''level'' every time you move. Is this correct? If not, could you please explain these commands to me in a better way. thanks McDougal...DUCK McDougal

Share this post


Link to post
Share on other sites
You''re pretty much right with glTranslatef, but way off with gluLookAt. gluLookAt is just a utility function that does all the matrix math etc, then calls glTranslatef and glRotatef to set the view position and orientation. There is no camera as such in OpenGL, the view is always drawn from 0,0,0 and you just move/rotate everything around that. gluLookAt just moves and rotates around the view.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You move the geometry around. gluLookAt does exactly this. By the way, there is really no "camera" in opengl - it''s just a way to describe what''s happening.

Share this post


Link to post
Share on other sites
thanks for the replys! So your ''camera'' can never have ''coordinates'' other then 0,0,0? Well, im understanding a lot better now, thanks

McDougal...DUCK McDougal

Share this post


Link to post
Share on other sites