OpenGL Frustum使用
透视投影
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.推导原理是根据相似三角形。