OpenGL Frustum使用

透视投影

OpenGL Projection Matrix

Frustum

opengl中使用Frustum来设置透视投影,函数原型:
frustum(float left, float right, float buttom, float top, float near, float far);

注意,near的值不能为0。 参考:OpenGL ES之glFrustum函数

从透视投影矩阵的推导过程理解

xp = xe* near / -ze;

xp是投影后的坐标,xe是摄像机坐标系下的坐标,near为0,xp恒为0.推导原理是根据相似三角形。

posted @ 2018-05-21 22:40  北冥有鱼其名为鲲  阅读(924)  评论(0编辑  收藏  举报