王朝百科
分享
 
 
 

gluPerspective

王朝百科·作者佚名  2010-03-06  
宽屏版  字体: |||超大  

gluPerspective

NAME(函数名称)

gluPerspective -- set up a perspective projection matrix (设置透视投影矩阵)

C SPECIFICATION(C语言实现示例)

void gluPerspective(

GLdouble fovy, //角度

GLdouble aspect,//视景体的宽高比

GLdouble zNear,//沿z轴方向的两裁面之间的距离的近处

GLdouble zFar //沿z轴方向的两裁面之间的距离的远处

)

PARAMETERS(参数含义)

fovy

Specifies the field of view angle, in degrees, in the y direction.

指定视景体的视野的角度,以度数为单位,y轴的上下方向

aspect

Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

指定你的视景体的宽高比(x 平面上)

zNear

Specifies the distance from the viewer to the near clipping plane (always positive).

指定观察者到视景体的最近的裁剪面的距离(必须为正数)

zFar

Specifies the distance from the viewer to the far clipping plane (always positive).

与上面的参数相反,不再啰嗦的翻译了(这个参数也必须是正数)

DESCRIPTION(说明)

gluPerspective specifies a viewing frustum into the world coordinate system. In general, the aspect ratio in gluPerspective should match the aspect ratio of the associated viewport. For example, aspect = 2.0 means the viewer's angle of view is twice as wide in x as it is in y. If the viewport is twice as wide as it is tall, it displays the image without distortion.

gluPerspective这个函数指定了观察的视景体(frustum为锥台的意思,通常译为视景体)在世界坐标系中的具体大小,一般而言,其中的参数aspect应该与窗口的宽高比大小相同。比如说,aspect=2.0表示在观察者的角度中物体的宽度是高度的两倍,在视口中宽度也是高度的两倍,这样显示出的物体才不会被扭曲。

The matrix generated by gluPerspective is multipled by the current matrix, just as if glMultMatrix were called with the generated matrix. To load the perspective matrix onto the current matrix stack instead, precede the call to gluPerspective with a call to glLoadIdentity.

由gluPerspective产生的矩阵是与当前矩阵与指定的矩阵相乘得到的,就好像是glMatrix()调用被产生的矩阵一样。为把吧透视矩阵替代当前矩阵压栈,在调用gluPerspective之前要先调用glLoadidentity()这个函数.

补充,这段话的意思就是说(个人理解),这个gluPerspective的实现是通过将当前矩阵与你通过这个函数指定的参数而建立的矩阵相乘来实现的,而在OpenGL中,矩阵的相乘都是连乘的,也就是说,你调用这个函数会与其他的变化矩阵的函数效果相叠加从而影响原矩阵(当然有时候确实需要这样做),所以,在调用这个函数之前,通常需要先调用glLoadidentity来把当前矩阵单位化,从而使各种变换效果不会叠加,比如旋转就之旋转,透视就只透视,通过调用glLoadidentity就不会既旋转有透视了。

请参考《OpenGL编程指南》一书,或访问本人博客:http://fancylst6.blog.163.com/blog/#pn5《OpenGL入门五》

gluPerspective

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
如何用java替换看不见的字符比如零宽空格​十六进制U+200B
 干货   2023-09-10
网页字号不能单数吗,网页字体大小为什么一般都是偶数
 干货   2023-09-06
java.lang.ArrayIndexOutOfBoundsException: 4096
 干货   2023-09-06
Noto Sans CJK SC字体下载地址
 干货   2023-08-30
window.navigator和navigator的区别是什么?
 干货   2023-08-23
js获取referer、useragent、浏览器语言
 干货   2023-08-23
oscache遇到404时会不会缓存?
 干货   2023-08-23
linux下用rm -rf *删除大量文件太慢怎么解决?
 干货   2023-08-08
刀郎新歌破世界纪录!
 娱乐   2023-08-01
js实现放大缩小页面
 干货   2023-07-31
生成式人工智能服务管理暂行办法
 百态   2023-07-31
英语学习:过去完成时The Past Perfect Tense举例说明
 干货   2023-07-31
Mysql常用sql命令语句整理
 干货   2023-07-30
科学家复活了46000年前的虫子
 探索   2023-07-29
英语学习:过去进行时The Past Continuous Tense举例说明
 干货   2023-07-28
meta name="applicable-device"告知页面适合哪种终端设备:PC端、移动端还是自适应
 干货   2023-07-28
只用css如何实现打字机特效?
 百态   2023-07-15
css怎么实现上下滚动
 干货   2023-06-28
canvas怎么画一个三角形?
 干货   2023-06-28
canvas怎么画一个椭圆形?
 干货   2023-06-28
canvas怎么画一个圆形?
 干货   2023-06-28
canvas怎么画一个正方形?
 干货   2023-06-28
中国河南省郑州市金水区蜘蛛爬虫ip大全
 干货   2023-06-22
javascript简易动态时间代码
 干货   2023-06-20
感谢员工的付出和激励的话怎么说?
 干货   2023-06-18
 
>>返回首页<<
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有