Jump to content
  • Advertisement

Archived

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

mitchw

Octree Dimensions

This topic is 6917 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

Should the Root cube of an octree be a perfect "cube". More often than not, if you construct the cube by taking the min and max points of a map, you will not get a perfect cube. In the case of a "tribes" map, you would get a root area that is very wide and deep, but not relatively high. Any drawbacks to this?

Share this post


Link to post
Share on other sites
Advertisement
I don''t think so. I''ve implemented my landscape engine using a quadtree both width and depth are the same but the height is different, I don''t see any reason why it wouldn''t work even if the width and depth were also different.

The only advantage that comes to mind when having a perfect cube would be that all mins and maxs would be the same so you could just have 2 floats instead of 6.

I think Tribes uses a distance based quadtree.

Rick

Share this post


Link to post
Share on other sites
There''s nothing that says that the root cube must be a perfect cube. In fact your nodes (including the root) can be any shape you want, the important thing for an octree is that there are eight children to each node and they together cover the exact same volume as their parent. I would recommend that you at least keep the side orthogonal to each other though as traversal of the tree can be very difficult otherwise. The children probably should have the same shape as their parent as well but scaled with 0.5.

I can''t see any drawbacks of using a ''flat'' cube as you describe, but for terrain you are probably better of with quadtrees as md2ge suggests.



- WitchLord

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!