首页 > 其他 > 详细

《高效学习OpenGL》之 投影变换 glFrustum(),gluPerspective(),glOrtho(),gluOrtho2D()

时间:2014-02-19 11:00:38      阅读:523      评论:0      收藏:0      [点我收藏+]

投影变换的最终目的是定义一个视景体,视景体有两个用途,首先,视景体是决定一个物体是如何映射到屏幕的,

其次,视景体定义了哪些物体(或物体的一部分)被裁剪到最终的图像之外

1.透视投影

   void glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);

bubuko.com,布布扣

void APIENTRY gluPerspective (
	   GLdouble fovy, 
	   GLdouble aspect, 
	   GLdouble zNear, 
	   GLdouble zFar);
   //fovy:角度 aspect:纵横比 zNear:观测点与近侧裁剪截面的距离 zFar:与远侧裁剪截面的距离
   gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0);

bubuko.com,布布扣


2.正射投影

void APIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);

void APIENTRY gluOrtho2D (
	   GLdouble left, 
	   GLdouble right, 
	   GLdouble bottom, 
	   GLdouble top);

bubuko.com,布布扣


《高效学习OpenGL》之 投影变换 glFrustum(),gluPerspective(),glOrtho(),gluOrtho2D()

原文:http://blog.csdn.net/biggbang/article/details/19414437

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!