PDA

View Full Version : glViewPort problem



will_cn
12-03-2002, 05:06 AM
I used muti-viewport in my program. my view was use gluPerspective(45.0,aspect,4.0,vfar) code. In my sub-viewport, I wanna to draw a 2D-like background by using
glBegin(GL_QUADS)
glVertext3d(x1,y1,0.0);
glVertext3d(x2,y1,0.0);
glVertext3d(x2,y2,0.0);
glVertext3d(x1,y2,0.0);
glEnd();

I used gluUnproject(realx1,realy1,0.0,...x1,y1,z1) to get the value of x and y.

Well,when initially run, it seemed all right.But when I increased the value of vfar,the parameter of gluPerctive,the background of sub viewport suddenlly disappeared.

mikael_aronsson
12-03-2002, 05:59 AM
Hi !

Switch to orthographic mode and draw the quad, then you can switch back to perspective mode¨so you don't need to mess around with unproject.

Mikael