Page 1 of 1

about octree

Posted: Mon Mar 27, 2017 2:28 am
by leslie
when I read your DgmOctree .cpp code ,I found a variable called maxDiagFactor (double maxDiagFactor = squareRadius + (0.75*cs + SQRT_3*radius)*cs;)
and It decides whether the cell is in totally inside or outside ((cellCenter -query_point).norm2d() <= maxDiagFactor),I wonder how does the maxDiagFactor is defined !is it an experienced value?

Re: about octree

Posted: Mon Mar 27, 2017 7:01 pm
by daniel
Well, I believe it's simple maths to detect the potential intersection of a box with a sphere, without spending too much times into details (i.e. the worst case, considering the box diagonal and the distance to any point in the cell, i.e. the farthest vertex of the cell bounding-box). But right now I can't remember what exactly the computation was ;).