Octrees in Direct X

Started by
8 comments, last by Helicon56 21 years ago
Hi, does anyone know where there''s any examples of using octrees with directX? i''ve got a basic octree working and i understand how its working and everything, but i''m still not sure whats the best way to do them in directX... does anyone have any information on it? Thanks, Helicon56.
Advertisement
I would suggest using the Octree tutorial at gametutorials.com and modify it to work with Direct3D.
Unfortunately, you are correct. I did a search and didn''t find any implementations in D3D.

-dizzy
-dizzyGame Institute InternPlease rate me. :)
Are you using this octree for your outdoor terrain? If you are, and you''re using it the way gametutorials shows, please let me know how it works out

Thanks!
Actually it really depends on what you are using the octree to render. If everything is static in your scene then your implementation will be different than if all your objects are dynamic. Also, if you are using a LOD scheme for terrain this will cause it to be different.

-dizzy
-dizzyGame Institute InternPlease rate me. :)
Octree for an outdoor terrain? Why wasting so much memory on an octree if you can simply create a static structured Quadtree? Just looks more complicated, uh?

narbo
Yeah im going to be using it for outdoor terrain...
I downloaded the octree tutorials from gametutorials so i''ll go through them in a bit.
I''ve got a terrain model stored in an x file, and from the vertex buffer and index buffer i''m making a new index buffer at each node. I''m just not sure how to incorporate the index buffer in the drawing of the mesh, since up until now i''ve just been looping through the mesh''s textures and calling DrawSubset(). Any ideas?
The terrain will be static, but i''ll be using dynamic objects along with the octree for collision detection.

thanks for you help,
--helicon56.
try: www.deepspacesaga.com
source: directx9
try: www.deepspacesaga.com
source: directx9
narbo: what do you mean by a static structured quad tree?
Thanks!
If you have something "perfect" like a terrain it's sure that nodes end by a certain depth (when every leaf node encloses a batch). This fact can save you a lot of memory because you can calculate the offset of the next node easily and you don't have to store "children pointers".

I just call it static structured quadtrees.. not sure if it has any name.. don't know!

narbo

[edited by - narbo on March 26, 2003 1:33:11 PM]

This topic is closed to new replies.

Advertisement