0

I'm implementing octree data structure. In octants i store triangles. So question: When i need to to stop dividing octants in Octree? I think about max depth or number of max number of triangles in octant, but how i can calculate this values?

  • You cannot calculate these values, you need to try out what works best for a given dataset. Good starting values are "10" for entries per octant and maybe 10 or 20 for depth. For depth there is a max limit given by the precision of your coordinates. – TilmannZ Nov 23 '21 at 18:43

1 Answers1

1

A good rule for many circumstances is to subdivide a box if the number of triangles in it is more than twice its depth in the tree. This ensures that:

  1. The total space consumed by the tree is at most proportional to the number of trianges;
  2. The total time spent traversing down the tree is at most proportional to the number of triangles you'll have to directly process in the target leaf; and
  3. You can still go deep when necessary to decompose a tight cluster.
Matt Timmermans
  • 53,709
  • 3
  • 46
  • 87