基于拓扑映射的背向面去除算法
An Algorithm for Backface Culling Based on Topological Mapping
-
摘要: 场景往往由多边形逼近表示,提出的背向面去除算法首先将场景中的多边形法向量正则化为单位向量,并将起始点移至原点,这些单位向量必定位于单位圆球上;然后将单位圆球分成若干个中心对称的区域,每个区域进行拓扑映射得到参考平面,可以求得每个多边形法向量所在的区域,并求出多边形法向量在区域边界圆盘面上的拓扑映射坐标.对同一场景而言,这些计算只需进行一次,称为前置运算.当视点向量位置改变时,则需动态计算视点向量和正背向分界线在每个区域的拓扑映射坐标;然后在一维射影直线上根据视点向量、法向量和分界线之间的拓扑映射坐标位置关系,判断该多边形是否为背向面.实验结果表明,算法运行可靠,有较高的检测速度,尤其是对同一场景,当视点变化时的多次检测效果显著.Abstract: Scenes are commonly rendered by the polygon approach. In the method proposed in the paper on backface culling, at first the normal of the polygons inside the scene is normalized to unit vectors, then the start point of the normal is moved to the origin and thus these unit vectors are surely distributed on the unit sphere. The surface of the unit sphere is divided into several parts and each part topologically mapped into a reference plane. With the reference plane, we can get the space that the normal of the polygons locate and then calculate the topological mapping point on the disk boundary of the polygon normal. For a given scene, such pre-calculation only need once. When the position of the view vector is being changed, for each space, the topological mapping point of the view vector and the center back boundary are calculated dynamically. To each polygon, on the projection line, backface test could be made according to the position of its normal mapping point and the mapping point of the viewing direction. Experiments show that the algorithm is rapid, robust and easy for implementation.
下载: