inthefields

Hello :)

I was wondering how I would go about getting the (axis aligned) bounding box of a model after rotating and scaling it

 



Re: XNA Framework Bounding Box of a Model after rotating (and scaling) it.

CodePfo

You can transform the box corners by the model's matrix, although since it's axis aligned it won't be useful for testing.




Re: XNA Framework Bounding Box of a Model after rotating (and scaling) it.

inthefields

Thanks for the answer CodePfo,

yet I fear simply rotating the AABB is not quite what I am looking for.

Rotating a model can change a model's AABB considerably. Think of a model shaped like a long tube for instance. When it is positionened along the z-axis it's bounding box is simply an unrounded version of the tube. Position the tube diagonally in the scene and the its bounding box will look completely different.





Re: XNA Framework Bounding Box of a Model after rotating (and scaling) it.

ClydeCoulter

Rotating the AABB can work (depending on what you're after) if you then reconstruct it into an AABB. using the mins and maxs.