Octree sample code for XNA

 

In 3D world, many enthusiastic specialists and PhD are giving their life-time effort to rendering photorealistic objects like milk, skin, water, feather, shadow, etc. No doubt that it is good to have all these physical models about the rendering. When it comes to practical application, we, however, have to made a tradeoff between quality and performance and most of the time, the result yield at the later choice.

Demanding an application with excellent performance, we need to manage our scene wisely with some structures like BSP, Octree, Space partition index, and other similar techniques. Today I am going talk about Octree which has been using on out-door scene for decades.

According to the description of Wikipedia, An octree is a tree data structure in which each internal node has up to eight children. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees. Octrees are employed in many out-door scene rendering since they can efficiently culling the invisible objects and they are easy to build and maintain.

In practice, we do not follow the strict rules ( as least, I don’t) made by the subdivision of octree. In the rule, each leaf of octree need to be fully occupied or fully empty, which means lots of processing time is consumed to fulfill. An alternative way of solving this can be setting up a maximum subdivision level, maximum numbers of geometries in the tree, maximum geometries in each tree node. By creating these limitation, an octree will be faster build and easier to update.

As I am digging in XNA these days, the sample project is in XGS 2.0 format.



转载于:https://www.cnblogs.com/eric720/archive/2008/06/11/1217633.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值