Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fast, templated, C++ Octree implementation

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.

like image 569
Robinson Avatar asked May 11 '11 12:05

Robinson


People also ask

How do you implement an octree?

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.

What is Octrees in computer graphics?

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.


2 Answers

  • 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.

like image 73
2 revs Avatar answered Oct 03 '22 23:10

2 revs


Also recently released: http://www.openvdb.org/

A volume hierarchy format by Dreamworks.

like image 38
Jeroen Baert Avatar answered Oct 04 '22 01:10

Jeroen Baert