BSP 樹 和 八叉樹

八叉樹:

The Quadtree

derives  from the idea of dividing a square area into smaller squares.

start with a unity square as the root of the tree, now divide the square into four smaller aquares.

 

each of the new smaller squares is a child node of the root.  the next step is to repeat the process on the small suares

generating four more sub-squares and hence four children at the next level of the tree for each of them

imageimage

The Octree

in three dimensions the square is replaced by a cube and the division into four is replaced by a division into eight sub-cubes hence oct-tree,

Thus the octree is just a generalisation of the quadtree to 3D. Each node corresponds to a single cube and has exactly eight sub-nodes

imageimage

BSP樹

 

bsp_tree(poly* current_poly){

   while(still_polygons){

      partition_polygons(current_poly);

    }

bsp_tree(current_poly->left);

bsp_tree(current_poly->right);

}

image

 

應用

1. 查找

image

2.可視判斷

image

3. 區域

image

 

 

http://dip.sun.ac.za/~henri/bsp_tutorial.pdf

http://web.cs.wpi.edu/~matt/courses/cs563/talks/bsp/bsp.html

http://jp.51studyit.com/article/details/62900.htm

http://www.i-programmer.info/programming/theory/1679-quadtrees-and-octrees.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章