【发布时间】:2016-02-11 18:26:39
【问题描述】:
我正在使用下面的代码 sn-p 根据用户的选择在正交投影和透视投影之间切换。然而,不管用户的选择如何,渲染的模型总是处于正交投影中。您能否让我知道我在这里缺少什么。
如上所见,目前得到的透视投影只是正交投影的放大版。
谢谢。
float fov = 10.0;
float Oleft = -1.0, Oright = 1.0, Obottom = -1.0, Otop = 1.0;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(proj_type==0)
gluPerspective(fov, 1, 0.1, 200);
else
glOrtho(Oleft, Oright, Obottom, Otop,0.1,50);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(10, 7, 10, 0, 0, 0, 0, 1, 0);
【问题讨论】:
-
10 度是一个非常紧凑的 FOV。
标签: c++ opengl projection perspective orthogonal