True, I don't know that the matrix changes will be a problem. I just see I'm going to be switching them a bunch, so was wondering if there are any tricks I'm missing, or if I should even worry about this.
My perspective layers are drawn at an angle. It might be pretty tricky to fake ortho and still get the layers drawn at the correct depths.
FWIW, I'm also implementing this on the iPhone. Below are the current OpenGL calls, organized a bit differently than the LWJGL above:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| while (true) { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glRotatef(...); glFrustumf(...); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glMultMatrixf(...); glTranslatef(...); glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); } |
It certainly seems like a lot of stuff, especially if that is happening multiple times per frame. Is the way I'm doing this ideal? Does it matter if I push and pop ortho or would it be better to push and pop perspective?