平截锥体

       平截锥体是一个六面体,在游戏中(虚拟现实仿真也会用到)的最大用处就是描述摄像机的视域。平截锥体最大的特征是上下两面是平行四边形。平截锥体的功能需求和应用场景相对简单,所以不需要过多的功能。
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是原点到平面的距离。点到平面的距离可以是负的,当该点在平面的背面时,即与平面的法向量的方向相反时,该点到平面的距离为负。
参考:《游戏引擎设计与实现》

转载于:https://www.cnblogs.com/QQ122252656/p/4232186.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值