# 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.

## 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 on other sites
Both approaches sound fine. Which one is faster depends on the implementation, I think.

Anyway, what you're doing is called (minimum) bounding sphere, which has been studied well and is discussed here calculating minimal bounding sphere?. You can even find source.

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 16
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632659
• Total Posts
3007691
• ### Who's Online (See full list)

There are no registered users currently online

×