Octree sample code for XNA

Posted on 2008-06-11 22:44 SigEric 阅读(174) 评论(3)  编辑 收藏 所属分类: 工作日志
 

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.



Tag标签: XNA,Octree,3D,Rendering

Feedback

#1楼    回复  引用  查看    

2008-08-05 17:57 by 荔橙伊珊雨      
E文?呵呵。294521555,交个朋友。

#2楼    回复  引用  查看    

2008-09-01 12:49 by 齐.net      
Well,
I find it.

#3楼    回复  引用    

2008-09-27 00:36 by phena109 [未注册用户]
Thank you for you example code. It is very useful when I use it as a reference.

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-08-06 10:17 编辑过


相关链接: