首页 > 其他 > 详细

平截锥体

时间:2015-01-18 20:52:46      阅读:345      评论:0      收藏:0      [点我收藏+]
       平截锥体是一个六面体,在游戏中(虚拟现实仿真也会用到)的最大用处就是描述摄像机的视域。平截锥体最大的特征是上下两面是平行四边形。平截锥体的功能需求和应用场景相对简单,所以不需要过多的功能。
enum Frustum
{
  RIGHT       = 0,    // The RIGHT side of the frustum
  LEFT         = 1,    // The LEFT  side of the frustum
  BOTTOM  = 2,    // The BOTTOM side of the frustum
  TOP          = 3,    // The TOP side of the frustum
  BACK        = 4,    // The BACK side of the frustum
  FRONT     = 5     // The FRONT side of the frustum
}; 
每个枚举项都是一个面,可以用面描述方程解释:
enum PlaneData
{
  A = 0,        // The X value of the plane‘s normal
  B = 1,        // The Y value of the plane‘s normal
  C = 2,        // The Z value of the plane‘s normal
  D = 3         // The distance the plane is from the origin
};
Ax+By+Cz+D=0;
其中Vector3(A,B,C)是平面的法向量,D是原点到平面的距离。点到平面的距离可以是负的,当该点在平面的背面时,即与平面的法向量的方向相反时,该点到平面的距离为负。
参考:《游戏引擎设计与实现》

平截锥体

原文:http://www.cnblogs.com/QQ122252656/p/4232186.html

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