Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5931475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:42:00+00:00 2026-05-22T14:42:00+00:00

I have managed to calculate the bounding sphere radius in two ways, but none

  • 0

I have managed to calculate the bounding sphere radius in two ways, but none is giving me exactly what I want. I don’t need a “pixel” perfect bounding sphere but I would like something better than what I currently have.

I’m using Wavefront .obj models and to calculate the bounding sphere radius for those models I extract the current model dimensions (I’m using the GLM library from Nate Robbins) which will give me the dimension on each axis.

First approach:
Divide each axis by 2 and that will give me the radius on each axis. The largest is the one I’ll use for my bounding sphere. This will work for most objects specific to my project. It will not work for some, like cube-shaped ones. Basically, if I have a cube and calculate the radius with this approach, the sphere will leave the cube corners outside.

Second approach:
Divide each axis by 2 and that will give me the radius on each axis. Then I do this to take out the radius for the bounding sphere:

r = SQRT(x*x + y*y + z*z)

But this gives me a pretty large radius. The object will be totally enclosed in the sphere but the sphere is pretty large, more than it should be.

I don’t understand what I’m doing wrong in the formula above, as far as I know it, it should work. But I’m obviously wrong…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:42:00+00:00Added an answer on May 22, 2026 at 2:42 pm

    Your second approach should give you the bounding sphere for your bounding box, but as you discovered, it will be larger than necessary for anything other than a box.

    A better bounding sphere can be found by translating the model points so they’re centered on the origin using the bounding box dimensions you already have, then for each individual vertex calculate the radius from the origin for that point using the sqrt(x*x + y*y + z*z) formula. Whichever of those is the largest is the radius of your bounding sphere.

    Note that this won’t be the optimal bounding sphere. For that you’d have to find the convex hull of your model and use something like rotating calipers to pick the optimal center point for the sphere.

    To show it in 2D, the red outline is the bounding box of the shape, and the blue circle is the bounding circle of the box. The improved circle using the polygon vertices, and centered on the box is green. Note that none of the points of the black polygon touch the blue circle.

    polygon (black), bounding box (red), bounding circle of the poly (green), bounding circle of the box (blue)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have polymorphic tagging model and I want to create tag_cloud for it, but
I have managed to calculate the dct of an 8*8 matrix and I am
I have managed to set up Cassandra + Thrift and the Python wrapper for
I have managed to get a cron job to run a rake task by
I have managed to create a custom action in C# using MakeSfxCA which is
If I have managed to locate and verify the existence of a file using
So far I have managed to write some code that should print the source
Ok so I have managed to get the format of the date presented in
I have an assembly which I have managed to make visible to VB6 and
I have installed Delphi Prism and XNA Game Studio 3.0. I have managed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.