Jump to content
  • Advertisement
Sign in to follow this  
alessio_pi_

problem with coordinate system

Recommended Posts

I have two coordinate system LOCAL SYSTEM A and LOCAL SYSTEM B. OA and OB is the position about LOCAL SYSTEM A and LOCAL SYSTEM B respect to WORLD SYSTEM.

https://drive.google.com/open?id=1MIRt1HE84qKWO0pC9L_68NeIIHVyxL90

Let P0, P1 ,P2 are vertices about 2d triangle respect to LOCAL SYSTEM B. Let P0T, P1T, P2T the final vertex after apply a Rotation respect to LOCAL SYSTEM A. I would like find a trasformation respect to LOCAL SYSTEM B to move the local point P0, P1, P2 into P0T, P1T, P2T.

Let . the product operator between matrix and from matrix and vertex. Let MB the trasformation coordinate from LOCAL SYSTEM B to WORLD SYSTEM. MB.P0 give me the position about the vertex P0 respect to WORLD SYSTEM. Let MA the trasformation coordinate from LOCAL SYSTEM A to WORLD SYSTEM. I would like know the matrix MX where

 

MB.MX.P1=P1T MB.MX.P2=P2T MB.MX.P3=P3T

The matrix Mx express a trasformation in LOCAL SYSTEM B.

Share this post


Link to post
Share on other sites
Advertisement

I'm not quite sure whether I understand your problem correctly.

A) Generally one wants not to map particular vertices but the entire space. The common space, so to say, is the world space. So, using your matrix names, we have

    MB . MX = MA   <==>.  MB^-1 . MB . MX = MB^-1 . MA.  <==>.  MX = MB^-1 . MA

or in words: from A to world and back to B. This makes sense only if MB is known and given.

B) If you really want to use particular vertices and all but MX is known, then you have up to 6 unknown values in MX (it's 2D, isn't it?) With 3 vertices you have 6 equations, so it can be solved in general, too. However, usually you have some constraints on MX, for example being a composition of translation, rotation, and perhaps scaling, which gives you just 5 unknowns in 2D if scaling is not uniform along both axes, and just 4 unknowns for uniform scaling, and just 3 without scaling. In such cases you need to think of how to consider this.

Share this post


Link to post
Share on other sites
MB.Mx=MA.T.Inverse[MA].MB where T is a composite tranformation and in my example is R
Mx=Inverse[MB].MA.T.Inverse[MA].MB

Inverse[MA].MB change coordinate from B to A
T apply transformation in A space.
MA convert the transform Points in space A in world position.
maybe work?

 

image.png

Share this post


Link to post
Share on other sites

Applying MA . T . MA^-1 . MB means that vertices given in coordinates in relation to space B are transformed by T that is given in space A, and the result is given in world coordinates (assuming column vector notation, as usual).

However, in the OP you ask for MX being the equivalent of T but within space B. Hence you need to resolve MB . MX = ..., so

   MX = MB^-1 . MA . T . MA^-1 . MB

This step is not necessary if you want the vertices in world space anyway, of course.

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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!