ok, I am relatively new to OpenGL (student didn’t have the time between finals and APs).
Anyway, I drew some stuff in OpengGL and now I want to navigate through the environment being able to look up, down, left and right, instead of walking forward or sideways… I am using glTranslatef() to move the camera… is there a more efficent way to navigate through the world? or how about turning the camera 60 or 90 degrees w/o moving?!?
There are no camera in OpenGL. Just a viewpoint located at the world origin.
When you move the “camera” forward, you are actually moving the world backwards. This is the only way to do it in OpenGL, aswell as in any API. Ok, some API’s got functions that say you move the camera, but actually you are moving the world in the oposite direction.
You should either use glTranslate/glRotate OR gluLookAt (i recomend you use this one) to setup the viewpoint.
I used to use glRotate and glTranslate to do all my object and camera positioning. Then I ran into a problem when I wanted to render transparent polygons correctly. The only solution I could come up with was to largely abandon the use of glRotate and glTranslate, and do my own object->world->clip transforms so that I could have the depth info needed to sort the transparent polys. Just letting you know in case you run into the same problem.
[This message has been edited by DFrey (edited 06-05-2000).]
Check out OpenGl SuperBible version 1.0 which I believe is free online. Has the code you need I forget where also I forget the URL but am sure you can find it. Is what I use and works perfectly.