Not sure whether I’m thinking wrongly about my problem or whether I just not haven’t found the right way to do it yet, but here it is.
What I want to do is apply a rotation to the projection matrix and then apply glOrtho. Why do I want to do that? Because the objects I draw are given to me in another referential. Of course I could just rotate the modelview before drawing the objects (and this works) but I don’t understand why the rotation of the projection matrix does not work.
glMatrixMode(GL_PROJECTION); glLoadIdentity(); // where I would like to insert some glRotatef glOrtho(-150, 150, -100, 200, 1, 10000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(-300, 0, 300, 0.0f, 0.0f, .0f, 0.0, 1.0, 0.0); glRotatef(-90.0f, 1.0, .0f, .0f); glRotatef(180.0f, .0, .0f, 1.0f); // draw my objects here
Now what I would like to do is get the same effect but by rotating the projection matrix (where I put the comment in the code). If I rotate around the z axis, the objects are drawn correctly, just with another orientation. But if I apply a rotation of 90 degrees on x, than the object get completely crushed on one of the side of the viewport.
Any advice / light shed on this would be really welcome!!