Sign in to follow this  
Megelan

Transforming Bounxing Box Extents

Recommended Posts

Megelan    122
Hello ! I have nearly finished writing a oriented bounding box class. The bounding boxes have each a Center three Axes three Extents I also can calculate the 8 corner vertices from the Center and the three Axes with the three Extents. Now I want to transform a bounding box with a Transformation Matrix from local to world. It's easy to transform the Center and the Axes (the center vector is multiplied by the full transf.matrix and the axes are multiplied by the rotation part of the transf.matrix) But what's with the extents, I think they should also be transformed in some way, right ? But how ? Thank you for helping ! Best greetings, Megelan edit: Well I already know that the Extents have only be transformed with the scale part of a transformation matrix but how should I do it ? Pseudo code would look like this... for (i= 1 to 3) NewExtents[i]= Extents[i] <combine> ScaleOfTransformationMatrix ...but getting the ScaleOfTransformationMatrix isn't that easy, am I right ? =/ [Edited by - Megelan on October 16, 2004 12:00:36 PM]

Share this post


Link to post
Share on other sites
Charles B    863
Right.

Only uniform scaling can make sense OK. Else your transformed box is no more a box.

Then as you seem to imply that you have the rotation and scaling matrices separated. That can't be more eazy. Just scale your extents by Scale[0][0] or [1][1] or [2][2], since they are all equal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this