Sign in to follow this  

Basic question about octrees

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

I've started to look at octrees, mainly for collision detection, but I have a few questions. First of all, where in the octree do I store the different triangles (or pointers to them). Is it just in the leafs? Secondly, should I split triangles that are in more than one "box" (like when I build a BSP-tree)? And, finally, how do I use octrees for collision detection? Is it only to discard parts of the word where the collision couldnt have occured, or is there anything else to do?

Share this post


Link to post
Share on other sites
Quote:
Original post by zurekx
First of all, where in the octree do I store the different triangles. Is it just in the leafs?
Secondly, should I split triangles that are in more than one "box"

first give each shape a bounding box, you put the new shape in at the root but you keep moving it up the tree until it won't completely fit in a cube anymore

Quote:
Original post by zurekx
Is it only to discard parts of the word where the collision couldnt have occured

yes

Share this post


Link to post
Share on other sites
Splitting triangles is a hard decision, since it will affect the precision of your collision results, see Christer Erichson's GDC presentation from a couple of years ago on how to deal with robust triangle testing after splitting triangles.

If your dataset is not very dense you can just store triangles on all its overlapping leafs, and during testing keep track of which triangles have already been tested

Share this post


Link to post
Share on other sites

This topic is 3598 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this