Skip to main content
GameDev.net gamedev.net
🔒 Locked

Converting coordinate systems

Started by Darkbouncer4689 Aug 16, 2011 at 7:58 PM 1 replies 900+ views
Original Post
Darkbouncer4689
Darkbouncer4689
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!
luca-deltodesco
luca-deltodesco
Your coordinate system is defined by the 3 axis vectors and the centre vector which together produce a 4x4 matrix:

Image.

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]

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.