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
glVertext3d(x1, y1, 0.0);
glVertext3d(x2, y1, 0.0);
glVertext3d(x2, y2, 0.0);
glVertext3d(x1, y2, 0.0);
I used gluUnproject(realx,realy,0.0,…x1,y1,z1) to get the value of x1 and y1.Here realx and realy were the screen coordinate,and the x1 and y1 were the coordinate in OpenGL .
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.
How can I deal this problem? And How can I calculate the right value of zfar that I can display the scene correctly?