From AABB to bounding sphere

shuipi

Newcomer
Everyone says the method of obtaining a bounding sphere by using the AABB's center as the sphere center and half diagnal length as the radius will not give an optimal bounding sphere.

But I can't think of a case where it's not optimal. It looks pretty optimal to me: the radius can't be any smaller otherwise one of the AABBs' corner vertices will come out.
 
Ah never mind. I just realized that as long as the enclosed mesh doesn't have vertices coinciding with the AABB's vertices then this method returns bigger than necessary bounding sphere.
 
Yeah it's an annoyingly difficult problem (even in 2D) if you want a "perfect" solution, but several reasonable heuristics work ok in practice.
 
Back
Top