Sorry, I still haven’t found it out:
This is the OpenGL initialization that I do only once:
void InitGL(void)
{
glViewport(0, 0, 1280, 1024); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
glFrustum(-2.0f, 2.0f, -1.5f, 1.5f, 4.0f, 100000.0f); // !!! Assuming a Aspect-Ratio of 4:3 !!!
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f); // Depth Buffer Setup
glDepthFunc(GL_LESS); // The Type Of Depth Testing To Do
glEnable(GL_DEPTH_TEST);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}
I simplified my Frame rendering code even more:
void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-2.0f, 2.0f, -1.5f, 1.5f, 4.0f, 100000.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef((float)xmouseD , 0.0f, 1.0f, 0.0f);
glRotatef((float)ymouseD , 1.0f, 0.0f, 0.0f);
glPushMatrix();
glTranslatef(-1800.0f, 0.0f, -3000.0f);
glBegin(GL_QUADS);
glVertex3f(-250000.0f, -500.0f, -250000.0f);
glVertex3f( 250000.0f, -500.0f, -250000.0f);
glVertex3f( 250000.0f, -500.0f, 250000.0f);
glVertex3f(-250000.0f, -500.0f, 250000.0f);
glEnd();
glPopMatrix();
}
I still get the same result that correct rotations are only performed, when the “camera-vector” is the same as the one when no transformations have been performed at all.