Hello,I want to to transform the object (mesh ) :translate it along z axis (in the global coordinate system).
The problem is that it moves not along the z axis but diagonally (according to position /slope angle of the object) here is a snippet from the code.What do you think the problem is?
Like Aeluned said, the gluLookAt modify your coordinate system so applying a translate after it will translate according to the new system.
Also, doing this loop make every objects in your array of object (or whatever) translate from n. So your fifth object will actually translate by (0,0,5n). But maybe that is what you wanted ? If not your need to reset the modelview matrix after each object translation;
Thanks,
The problem is I have a lot of transformation to do
Translate1 Rotate1 Rotate2 Translate2 …
(some permutation of them)…
Because the order is important,how can I code this?