Basic question about octrees

Started by
1 comment, last by ldeej 16 years, 2 months ago
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?
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
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

This topic is closed to new replies.

Advertisement