# I want to get boundingbox min max of a skinned animation mesh

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

## Recommended Posts

i am finding it hard how i can get the bounding box of the whole mesh .x and not each bone frame ,anyone know how?

##### Share on other sites
Not sure there's a function for that...

My suggestion is obtaining the bounding box for every frame, grab the coords of each vertex, and then compare all those vertices, keeping the ones that make the biggest cube?

Not sure I explained that clearly...

##### Share on other sites
yes but i can get the bounding box min and max of a static mesh with no heirchy but not with a mesh with frames ,there must be some way to the min and max of the whole mesh just like you can with a static mesh

##### Share on other sites
This is an interesting problem, but I'm not sure there's a nice solution. As far as I can see, there are four options:

1. You can software skin all the positions and normals, performing a min/max on all positions to obtain perfect bounds. I do this on the PS2 and Wii (in optimised assembler of course) only because I have to software skin on those platforms anyway.

2. You can determine the maximal object space bounds (offline, in a tool) by animating the skin with every animation that it'll ever use, performing step 1 with each animation frame. Painful and slow to say the least. At runtime you'll need to transform the object space bounds to world space as required.

3. Estimate the bounds of the mesh (in object space) and transform into world space as required. There may be issues with applying animations that occassionally cause the verts to go outside your estimated bounds, but this shouldn't be too problematic (except if you need exact bounds like I do on PS2).

4. I pre-process the skinned mesh and determine the maximal distance of any vertex from its weighted bone. I store this in my skin structure as a "inflation radius". At runtime, I determine the bounds of the positions of the bones (using a simple min/max algorithm) and then inflate this box using the "inflation radius". This is seemingly the best compromise of speed versus accuracy (for my data anyway).

Hope this helps?

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634088
• Total Posts
3015453
×