本文会简述BSP树的应用和其算法原理。
正文:
一、前言
什么是BSP树?
In computer science, binary space partitioning (BSP) is a method for recursively subdividing a space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a representation of objects within the space in the form of a tree data structure known as a BSP tree.
BSP树的应用场景:
performing geometrical operations with shapes (constructive solid geometry) in CAD,(碰撞检测)collision detection in robotics and 3D video games,ray tracing(光线追踪),and other applications that involve the handling of complex spatial scenes.
BSP树的来源:
Fuchs,Kedem和Naylor在1980年左右引入了二进制空间分区树(或简称BSP树)。并有两篇发布的论文:"Predeterming Visibility Priority in 3-D Scenes" 和 "On Visible Surface Generation by A Priori Tree Structures",讲述了BSP树的实用性和如何实现它们。后来也有作者,在这两篇论文的基础上,结合了阴影的生成和动态场景的处理。
简单来说,BSP树是n维空间到凸子空间的分层细分(a BSP tree is a heirarchical subdivisions of n dimensional space into convex subspaces)。每个节点都有一个前叶子节点和后叶子节点。从根节点开始,所有后续插入都由当前节点的超平面划分。在二维空间中,超平面是一条线。 在3维空间中,超平面是一个平面。BSP树的最终目标是让叶节点的超平面在父节点超平面的前面或后面(这句可能翻译不太好,我把原句放上来:The end goal of a BSP tree if for the hyperplanes of the leaf nodes to be trivially "behind" or "infront" of the parent hyperplane.)
BSP树对于与静态图像的显示进行实时交互非常有用。 在渲染静态