   gluPerspective and glOrtho at the same time
  Hi.I'm trying to render a scene using both gluPerspective (for 3D elements) and glOrtho (for UI elements).I've noticed that I use glOrtho first, it seems to render just fine, but if I use gluPerspective first, the UI elements end up skewed.I want to use some transparency with the UI, so I need to render the 3D elements first. Am I doing something wrong here?SwapBuffers(m_hDC);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(45.0f,(GLfloat)WindowWidth/(GLfloat)WindowHeight,0.1f,100.0f);glMatrixMode(GL_MODELVIEW);glLoadIdentity();    glTranslatef(0, 0, -1);ScaleAllDimensions(0.1f);glRotatef(-60, 1, 0, 0);glEnable(GL_TEXTURE_2D);m_EgoShip.Draw();glDisable(GL_TEXTURE_2D);m_StarField.Draw();glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(-WindowWidth/2, WindowWidth/2, -WindowHeight/2.0f, WindowHeight/2.0f, 0, 10);glMatrixMode(GL_MODELVIEW);glDisable(GL_TEXTURE_2D);glColor3f(1, 1, 1);glPushMatrix();glTranslatef(100, 100, 0);glColor3f(1, 0, 0);DrawRoundedRect(GL_POLYGON, 200, 80, 10);glColor3f(1, 1, 1);DrawRoundedRect(GL_LINE_LOOP, 200, 80, 10);glPopMatrix();
  Try adding a glLoadIdentity() here:glPushMatrix();glLoadIdentity();glTranslatef(100, 100, 0);glColor3f(1, 0, 0);DrawRoundedRect(GL_POLYGON, 200, 80, 10);glColor3f(1, 1, 1);DrawRoundedRect(GL_LINE_LOOP, 200, 80, 10);glPopMatrix();;  Jumping Jehosaphat, that's all it was!It's working!Many thanks. If you ever need a kidney, I'd give you mine in a second.   