PDA

View Full Version : Getting Quad to fill viewport



jmt
03-26-2001, 10:46 AM
My question is the following:

I am rendering a quad with a texture that moves along the Z-axis. However, I am interested in the resulting image on the quad only, not the perspective view of the quad in the distance. How can I setup my viewport/camera so that the quad always fills up the screen regardless of the Z-position of where the quad was rendered.

In other words, I want to disregard the perspective view after the quad is rendered and always view the quad so that it fills my viewport.

Thanks

Lord Iceman
03-26-2001, 11:08 AM
try glOrtho to set up 2d mode

HFAFiend
03-26-2001, 11:21 AM
use gluOrtho2D after loading the identity on your projection matrix (gluOrtho2D is done to the projection matrix instead of the normal projection stuff)....the 4 parameters are left,right,bottom,and top...all doubles

rIO
03-26-2001, 11:03 PM
Here is some code :

glMatrixMode GL_PROJECTION
glPushMatrix
glLoadIdentity
glOrtho 0, width, 0, height, -1, 1
glMatrixMode GL_MODELVIEW
glPushMatrix
glLoadIdentity

//draw your quad with glVertex2i from 0,0 to
width,height


glMatrixMode GL_PROJECTION
glPopMatrix
glMatrixMode GL_MODELVIEW
glPopMatrix


hope it helps

rIO.sK http://www.spinningkids.org/umine