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 定义了远剪切面的距离

 

 

你可能感兴趣的:(function,object,Matrix)