Sign in to follow this  
Darkbouncer4689

Converting coordinate systems

Recommended Posts

Hey all,

Say I have two OBBs defined in terms of a center, 3 orthonormal axis vectors and 3 extents. I need to convert OBB B to OBB A's coordinate system. For the centers this is accomplished by subtracting OBB A's center from OBB B's center.

How can you change B's axes vectors to be in A's coordinate system? Sorry this may be a stupid question but this is stumping me.


Thanks for the help!

Share this post


Link to post
Share on other sites
Your coordinate system is defined by the 3 axis vectors and the centre vector which together produce a 4x4 matrix:

[url="http://latex.codecogs.com/gif.latex?begin{bmatrix}%20x_x%20&%20y_x%20&%20z_x%20&%20c_x\%20x_y%20&%20y_y%20&%20z_y%20&%20c_y\%20x_z%20&%20y_z%20&%20z_z%20&%20c_z\%200%20&%200%20&%200%20&%201%20end{bmatrix}"]Image.[/url]

So you have two coordinate systems A and B.

To go from coordinate system B to coordinate system A, you would premultiply the point/vector with AB[sup]-1 [/sup]

[size="2"]Of course you can probably simplify the maths greatly, if your axis vectors form an orthonormal set of vectors, in which case the upper 3x3 part of the coordinate system basis is an orthogonal matrix, and so it's inverse is simply it's transpose and so to premultiply with B's inverse, you would just subtract the centre vector, then premultiply with the transposed upper 3x3 part.[/size]

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