Setting the near plane in an infinite frustum.
How can I move the near plane closer in an infinite frustum?
I use these equations, but if I change the znear value, the FOV also changes,
and however 1 is too far for near plane in my scene, cause things get close
to the camera.
fov:=45*pi/180;
aspect:= 1.333;
znear := 1;
zfar := -1;
top:=znear*tan(fov/2);
bottom:=-top;
left:=aspect*bottom;
right:=aspect*top;
proj[0,0]:=2*znear/(right-left);
proj[1,1]:=2*znear/(top-bottom);
proj[2,0]:=(right+left)/(right-left);
proj[2,1]:=(top+bottom)/(top-bottom);
proj[2,2]:=-(zfar+znear)/(zfar-znear);
proj[2,3]:=-(2*zfar*znear)/(zfar-znear);
proj[3,2]:=zfar;//ZFAR
glMultMatrixf(@proj);
Thanks!
u cant have an infinite frustum u need valid near/far distances, see the faq at www.opengl.org
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement