I've been searching high and low (mostly on google) for a fast, efficient, templated (ie. with STL-like properties) octree implementation, without success. I want to use this in the context of a 3D scene graph.
Does such a thing exist, or do people generally roll their own? I'm hoping my friends at stackoverflow will know where to find one.
To insert a node in Octree, first of all, we check if a node exists or not if a node exists then return otherwise we go recursively. First, we start with the root node and mark it as current. Then we find the child node in which we can store the point.
An octree is a tree data structure in which each internal node has exactly eight children. Octrees are most often used to partition a three-dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees.
http://nomis80.org/code/octree.html
This is my favorite. It is GPL and has it's own homepage, so it's meant to be used by others. It has Doxygen documentation, and the authors are taking questions.
http://www.flipcode.com/archives/Octree_Implementation.shtml
This one is not templated. It has more comments in the code than every other I've seen, so that might be more useful if you are trying to find out how octrees work.
Also recently released: http://www.openvdb.org/
A volume hierarchy format by Dreamworks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With