0
votes

I have a scene in OpenGL, which is rotated and translated, and I would like to translate it further along its OWN Z axis. How should I reflect this ?

To be a bit more concrete: glTranslated (tx,ty,tz) gpRotated (rx,1,0,0) gpRotated (ry,0,1,0) gpRotated (rz,0,0,1)

What modification should I bring to the tx,ty,tz in order to translate the scene toward its own Z axis (which for the "camera" may be the X axis ?

1

1 Answers

1
votes

You should modify the model matrix with an additional glTranslate(). The model transformation is independent of the camera, so you can do all you want there. Just make sure to place the model in world space at the end and then use a view matrix which works in world-space (i.e. transforms world->camera space.)