Advertisement

lesson 17

Started by August 02, 2004 12:37 PM
0 comments, last by Brother Bob 20 years, 4 months ago
In Lesson 17, it looks like you push the Projection Matrix, push the Modelview Matrix, and then pop the Projection Matrix, and then pop the Modelview Matrix. Shouldn't you pop the Modelview Matrix before the Projection Matrix? What am I missing? Lesson 17 contains the following code: glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0,640,0,480,-1,1); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslated(x,y,0); // Position The Text (0,0 - Bottom Left) glListBase(base-32+(128*set)); // Choose The Font Set (0 or 1) glCallLists(strlen(string),GL_UNSIGNED_BYTE,string);// Write The Text To The Screen glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Each matrix mode has it's own matrix stack, so it doesn't matter in which order the different stacks are pushed and then popped.

This topic is closed to new replies.

Advertisement