PDA

View Full Version : Static part, Please help



guju
07-04-2002, 10:04 AM
Hi! I want to diplay all my 3d models, which i can rotate with the mouse. This works fine, but now i want to add a quad on the screen, which does not move during my mouse action. It should be static. Therefore i made:
Draw3d
glMatrixMode( GL_PROJECTION );
glPushMatrix();
glBegin(GL_QUADS);
glVertex2f(0,0);
glVertex2f(10,0);
glVertex2f(10,10);
glVertex2f(0,10);
glEnd();
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
The problem is the position of the quad. This is dependent of the settings of gluPerspective. Can i make it independent??
Thanks

help!!!


[This message has been edited by guju (edited 07-04-2002).]

Uther_Pendragon
07-04-2002, 11:53 PM
You should reset your projection matrix right after pushing the projection matrix
by calling glloadidentity()

... that should make your drawing independent of gluPerspective !


glMatrixMode( GL_PROJECTION );
glPushMatrix();
glLoadIdentity();

glBegin(GL_QUADS)
//** Draw
glEnd();

glPopMatrix();

Uther