QT_opengl_gluPerspective没有定义的处理方法

原地址:http://blog.sina.com.cn/s/blog_6b11cdda0101fe27.html

例如:
gluPerspective( 45.0, (GLfloat)width/(GLfloat)height, 0.1, 100.0 );
 
转换为:
GLfloat zNear = 0.1;
GLfloat zFar = 100.0;
GLfloat aspect = (GLfloat)width/(GLfloat)height;
GLfloat fH = tan(GLfloat(90.0/360.0*3.14159))*zNear;
GLfloat fW = fH * aspect;
glFrustum(-fW, fW, -fH, fH, zNear, zFar);
posted @ 2014-02-25 09:44  蓝夜  阅读(928)  评论(0编辑  收藏  举报