curious about glTranslatef...

Started by
3 comments, last by dirkduck 22 years, 8 months ago
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
http://www.labino.net
Advertisement
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.
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
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.
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
http://www.labino.net
gluLookAt is slow though



Open mouth, insert foot

This topic is closed to new replies.

Advertisement