From AABB to bounding sphere

Discussion in 'Rendering Technology and APIs' started by shuipi, Jan 2, 2011.

  1. shuipi

    Newcomer

    Joined:
    Mar 16, 2004
    Messages:
    73
    Likes Received:
    0
    Location:
    Beijing, China
    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.
     
  2. shuipi

    Newcomer

    Joined:
    Mar 16, 2004
    Messages:
    73
    Likes Received:
    0
    Location:
    Beijing, China
    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.
     
  3. Andrew Lauritzen

    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,526
    Likes Received:
    454
    Location:
    British Columbia, Canada
    Yeah it's an annoyingly difficult problem (even in 2D) if you want a "perfect" solution, but several reasonable heuristics work ok in practice.
     
  4. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,924
    Likes Received:
    5,293
    Location:
    Helsinki, Finland
    Or you can just use some library to calculate the smallest enclosing circles and spheres for you (assuming you have access to the vertex set of the object). A quick google search gave me this hit at least (GNU General Public License): http://www.inf.ethz.ch/personal/gaertner/miniball.html
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...