https://www.iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm
https://old.cescg.org/CESCG-2002/DSykoraJJelinek/
https://zhuanlan.zhihu.com/p/55915345
Optimized View Frustum Culling Algorithms for Bounding Boxes

主要参考:https://old.cescg.org/CESCG-2002/DSykoraJJelinek/

Figure 2 demonstrates the fact that the conversion of the AABB to the bounding sphere is not exact. If we measure the entire radius of the sphere and the distance from the center of the AABB we can see that we only need to compare its projection to the direction of the normal vector of the tested plane. There is one more dot product compared with the simple sphere-plane test. The following pseudo-code describes more implementation details of this method:

int AABBvsFrustum(AABB *b, FRUSTUM *f)
{float m, n; int i, result = INSIDE;for (i = 0; i < 6; i++) { PLANE *p = f->plane + i;m = (b->mx * p->a) + (b->my * p->b) + (b->mz * p->c) + p->d;n = (b->dx * fabs(p->a)) + (b->dy * fabs(p->b)) + (b->dz * fabs(p->c));if (m + n < 0) return OUTSIDE;if (m - n < 0) result = INTERSECT;} return result;
}

Vector (mx,my,mz) represents the center of the AABB. Absolute values of the normal vector of the plane (a,b,c) transform all possible values to the first octant so its dot product with the vector representing a half of the AABB diagonal (dx,dy,dz) will be always positive.

Three different values are possible as the output of the test that determines the continuation of the rendering pipeline.

OUTSIDE: Bounding box is totally outside of the VF so the bounded volume is also outside. The object or the dot hierarchy is eliminated from the further processing.
INSIDE: Bounding box is totally inside of the VF. There is no need for further culling of the geometry of the bounded object or down traversal the hierarchy. This state is also useful information for the software renderer that could avoid the low-level polygon clipping.
INTERSECT: Object could intersect the VF. The down traversal the hierarchy is needed and in the case of leafs the sending of the entire object for culling on the level of the object geometry.

AABB是否和视锥体相交相关推荐

  1. 视锥体裁剪(从矩阵中提取6个裁剪面)

    视锥体(frustum),是指场景中摄像机的可见的一个锥体范围.它有上.下.左.右.近.远,共6个面组成.在视锥体内的景物可见,反之则不可见.为提高性能,只对其中与视锥体有交集的对象进行绘制. 视锥体 ...

  2. 视锥体与AABB和OBB包围盒相交判断

    1.视锥体与AABB包围盒相交判断 template <class TYPE> class Frustum { public:Frustum(){}Frustum(const Frustu ...

  3. DirectX11进阶5_硬件实例化与视锥体裁剪及鼠标拾取交互

    一.硬件实例化(Hardware Instancing) 硬件实例化指的是在场景中绘制同一个物体多次,但是是以不同的位置.旋转.缩放.材质以及纹理来绘制(比如一棵树可能会被多次使用以构建出一片森林). ...

  4. 游戏场景管理(二)视锥体剔除

    在学习场景管理之前,我们要先学习一下视锥体剔除(VFC),因为无论你使用什么空间划分算法,划分的空间都要进行视锥体剔除,被剔除的空间内部的所有物件都会被抛弃以此来加速渲染或碰撞.这也是场景管理的核心目 ...

  5. 【unity】性能优化之——视锥体剔除(Frustum Culling)(一)

    一.应用背景 在现代游戏中,游戏资源越来越多,游戏场景也越来越大越来越复杂,虽说硬件设备更新迭代很快,性能也日渐强大,但这还远不能缓解复杂繁多的资源带来的性能压力,因而性能优化仍然很有必要.场景资源的 ...

  6. 土圭垚㙓数学课(二)视锥体八个顶点的计算方法

    视锥体是摄像机可见的空间,看上去像截掉顶部的金字塔.视锥体由6个裁剪面围成,构成视锥体的4个侧面称为上左下右面,分别对应屏幕的四个边界.为了防止物体离摄像机过近,设置近切面,同时为了防止物体离摄像机太 ...

  7. webgl 视锥体剔除不可见的物体

    这里新的东西就是 包围盒,就是把物体用盒子装起来,这样只需要计算面到这个是否相交,在外边,减少了很多计算量: 这个其实就是计算问题, 视锥体求的那个几个面的公式,自己用就可以了,不要问为什么,推导很麻 ...

  8. Unity HybridRender 视锥体裁剪

    Unity HybridRender 使用Unity.Rendering.FrustumPlanes 结构体来实现视锥体裁剪.这个结构体基本都为静态函数,其中使用NativeArray<Plan ...

  9. DirectX11 With Windows SDK--20 硬件实例化与视锥体裁剪

    DirectX11 With Windows SDK--20 硬件实例化与视锥体裁剪 原文:DirectX11 With Windows SDK--20 硬件实例化与视锥体裁剪 前言 这一章将了解如何 ...

最新文章

  1. android 广告效果图,android 仿首页广告轮播效果
  2. GML、SVG、VML的比较
  3. win7 部署tomcat
  4. java数字转换成字符串
  5. -wl是不是c语言的标识符,C语言基础知识考试
  6. checkbox问题
  7. 网页性能优化{雅虎[转载]}
  8. 公司要一个网站,是选模板建站还是定制化建站?
  9. java做界面_java怎么做出界面?实例讲解
  10. 回归平静是一种自我保护
  11. java安装及设置eclipse
  12. 旺旺号userid转换店铺shopid和评分性别
  13. python实现网站测速软件_网站测速插件是什么-和网站测速插件相关的问题-阿里云开发者社区...
  14. Oracle DBA学习基础篇(一) Oracle体系结构 学习笔记
  15. 从老板进位“一超”、方太列席“多强”,看厨电市场的竞争关键
  16. java计算时针和分针的夹角_【Java算法】一天24小时中,时针和分针一共重合多少次?...
  17. 第十八天:WEB攻防-ASP安全MDB下载植入IIS短文件名写权限解析
  18. jquery获取slideToggle状态
  19. 西瓜书决策树实现(基于ID3)补充——采用自定义数据结构实现
  20. 【C++】入门(上)

热门文章

  1. 插件分享 | 可以查看摄像头快照的“Hikvision插件”
  2. Efficient Zero-Knowledge Argument for Correctness of a Shuffle学习笔记(3)
  3. python计算字符长度
  4. GARP和GVRP的简介
  5. 动态解析ipv6地址,实现域名访问家里网络
  6. 自定义验证和数据处理的Utils工具类,适用Vue / React / UnApp / Meter / Nodejs
  7. 生信分析(1):单变量+多变量COX分析
  8. C#下载文件的方法包含本地下载,http下载,以及返回字节流方法
  9. 喝什么茶治胃病幽门螺杆菌?医生是这样说的
  10. 日本小学生就要学编程了