Original Post
🔒 Locked
bounding sphere
Advertisement
If you are using D3DX meshes, there is a function to compute the radius built in. otherwise, first you need to calculate the center, and then you can calculate the farthest vertex from the center.
I''m not positive, but I think if you sum up all the vertex positions and then divide by the number of verts, you will get a measure of center. you can then loop through all verts again, and calculate the distance from that point, and the biggest distance is your radius. depending on the model you might want to throw out outliers, or just shrink the radious at the end a bit. either way works pretty well.
I''m not positive, but I think if you sum up all the vertex positions and then divide by the number of verts, you will get a measure of center. you can then loop through all verts again, and calculate the distance from that point, and the biggest distance is your radius. depending on the model you might want to throw out outliers, or just shrink the radious at the end a bit. either way works pretty well.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement