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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不负初心

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值