Archived

This topic is now archived and is closed to further replies.

Octrees in Direct X

This topic is 5378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites