OpenGL投影

OpenGL use several function to realize thr projection

 

一,平行投影

1)

glOrtho (GLdouble left, GLdouble right,  GLdouble buttom, GLdouble top, GLdouble near, GLdouble far);

 

This function descripe a view Cuboid View of the object, the parameter has clearly tell the position of each. OpenGL use it to mutilply the matrix in order to realize the projection.

该函数创建了一个平行投影透视函数,OpenGL用这个函数乘以当前投影透视变化矩阵以实现平行投影。

2)void glOrtho2D(GLdouble left, GLdouble right,  GLdouble buttom, GLdouble top)

 

This function is utilized function of OpenGL Library. Its purpose is to translate the 2D shape into the plane. By default, the bottom is -1 and the top is 1.

 

二,透视投影

3)glFrustrum (GLdouble left, GLdouble right,  GLdouble buttom, GLdouble top, GLdouble near, GLdouble far);

 

这是用于透视投影,其参数的含义与glOrtho相同。

 

4)glPerspective (GLdouble fovy, GLdouble aspect, GLdouble near, GLdouble far)

 

fovy 定义了y方向上的视角。

aspect 定义了x方向上的观看区域,及长宽的比率。

(注意:在使用此函数的时候,视景体的长宽比率要与视口变换时采用的长宽比率是一样的,否则图像会在某个方向上拉升)

near 定义了近剪切面的距离

far 定义了远剪切面的距离

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值