PDA

View Full Version : draw fullscreen quad...



lobbel
04-20-2010, 08:00 AM
Hello,
maybe it's a stupid question, but there something confusing me.
Do I have to set the projection matrix to identity as well ?

Usually I do the following to draw a quad that covers the entire
viewport.

glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glBegin(GL_QUADS);
glVertex3f(-1.0f,-1.0f, -1.0f);
glVertex3f( 1.0f,-1.0f, -1.0f);
glVertex3f( 1.0f, 1.0f, -1.0f);
glVertex3f(-1.0f, 1.0f, -1.0f);
glEnd();
glPopMatrix();

for creating the projection i use the gluPerspective
with following values:
gluPerspective(90.0f, w/h, 1.0f, 100.0f);

For this settings the fullscreen quad does not cover the
entire viewport. I have borders on the right and left side.
But if the fovy is something below 50.0f then the quad fits the viewport.

So why does it happen ? On opengl.org there is an example drawing a fullscreen quad. they don't mention to change the
projection matrix.

regards,
lobbel

lobbel
04-20-2010, 08:03 AM
Solved,
I missed that part on opengl.org. They set the projection to identity.

regards,
lobbel