Jump to content
  • Advertisement
Sign in to follow this  

Computing Bounding sphere for a bunch of Triangles

This topic is 3125 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to generate a bounding sphere for given list of Triangles, which contains all the points within. I don't want it to be super-accurate, but yes, it should be reasonable. Here's what I have come up with. I cannot evaluate if it will yield a good approximation or not: - Iterate over all Triangles - Iterate over each vertex of the triangle - find the minX, minY, minZ and maxX, maxY, maxZ from these vertices (minX, minY or minZ values may not belong to the same vertex, its just a minima of the vertices along coordinate axis) - Find the midpoint between min and max - this yields the sphere center and radius (Also, I thought of this another approach..which builds on the bounding sphere iteratively. The idea being: - take a vertex and construct a sphere S around it with min radius (say 0.1) - iterate over all the other vertices (Vnew) of all the other triangles, and at each iteration, check: - if S does not contain Vnew - expand S to contain Vnew by taking the midpt btw S and Vnew as the new center; => update S - else (ie if S contains Vnew) - continue onto next vertex IMO, I think the second approach would be a more tight fit, but slow wrt first approach. What do you think of these ? I can really use some suggestions here. Thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!