例如:
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);
本文详细介绍了如何使用OpenGL进行视角转换,具体包括了如何利用gluPerspective和glFrustum函数来实现视图的透视效果。通过具体的代码示例,解释了各参数的意义及其对最终视图的影响。
3931

被折叠的 条评论
为什么被折叠?



