Jump to content
  • Advertisement
Sign in to follow this  
zurekx

Basic question about octrees

This topic is 3780 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!