gltranslate + rotate?!

just to clarify ,do the gl functions gltranslate and glrotate
change the camera matrix (IE move the camara around the objects in the 3d scene) or do they translate and rotate the objects in the view port (IE camara remains static and objects in viewport move?!) If they do translate the viewport camara how would i go about translating the objects in the viewport? Do I simply just re-draw every item in the viewport with the adjustments i require made??

I have a funny feeling i might get flamed for asking this questions, but i thought that was the point of a beginers forum!!

No flame honest.

The functions that you mention affect the modelview matrix i.e. the draw position. There is no camera matrix in opengl only a projection matrix that determines camera properties such of field-of-view, etc. gluLookAt imitates a camera matrix so even this small amount of confusion can be hidden from you if that is what you wish. Yes when objects move then you will want to inform opengl of this using a mixture of glTranslates and glRotates (with the updated values) or if you are up to it (probably not yet) then glLoadMatrix. I hope that this answers your question.


Iam pretty sure i understand what you mean, ive been studying some source of a solar system sim since posting and i see how you mean about there being no ‘real’ camara matrix. I tend to see people packing their changes between glpushMatrix and glpopMatrix commands, This quite strange to me at the moment but i dont see the point using glLookat if its only gonna restrict what I can learn and do in openGl!!! thanx

Just wanted to clarify a couple small points. glTranslate, glRotate don’t just operate on the modelview matrix. They operate on whatever the CURRENT matrix is. In most cases they should not be used with the projection matrix as they can mess up fogging and lighting calculations. gluLookAt should also not be used on the projection matrix, and if you are using it to simulate a camera positioning, it should be the first thing done to the modelview matrix after a glLoadIdentity

Deiussum, thanks for the clarification. I was incorrect to have said that the functions only affect the modelview matrix. What I should have said was that these functions should normally only be used to alter the modelview matrix. I stand corrected.