Solved

3D Coordinate Translation

Posted on 2009-04-10
3
1,148 Views
Last Modified: 2013-12-21
I am currently trying to translate the position and rotation of objects in two different coordinate systems.

I've tried to use Matrix transforms but it's not getting me the results I need, which leads me to believe I'm lost.

Both follow Right Hand Rule rotation.  

The first is 3D Studio Max:
Z axis - UP
X axis - RIGHT
Y axis - Into the screen

The next is:
Z axis - out of the screen
X axis - RIGHT
Y axis - DOWN

I've can easily translate the positions (z = -y, x = x, y = -z) but translating the rotation is causing me no end of grief.  Both systems can use euler angles (assume XYZ order of rotation), the second system has no concept of a world, so the world and the camera are fixed.
0
Comment
Question by:vaughanknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
Xcone earned 500 total points
ID: 24121503
To transform vertices from 1 space to the other you really need matrices, especially when rotation is involved. I do have to say, my experience with them is very limited, so I can't help you directly. But please check out this webpage:

http://www.euclideanspace.com/

It contains ton's of information about using matrices, vectors, and rotations. Including formulas and code samples. It has helped me a lot.
0
 

Author Comment

by:vaughanknight
ID: 24124188
Thanks.  I'd been looking at that site, but started to deep.  Having a read from the top level I'd recommend to anyone wanting to find information on it.

What I have discovered is that the coordinate system of Z - towards, X right, Y down is 180 rotation on the X axis of Direct 3D coordinates, which should help.  There is plenty of information on how to get objects into that coordinate system, and then it's a normal rotation on the X axis to get the final result.

http://www.euclideanspace.com/maths/standards/index.htm

I'll post my success later if I find it.
0
 

Author Comment

by:vaughanknight
ID: 24136961
Solution!

I figured out what was wrong.

I had been doing a matrix transform using

1  0  0
0  0 -1
0 -1  0

As Y (row2) goes to -Z, and Z (row 3) goes to -Y.

This was 100% correct.  But I'd take the Eulerangles to apply and no luck!

But 3DSMax gives eulerangles as XYZ, and it applies them as XYZ, but it's more important to speak about it in terms of what XYZ represent in general terms, not axes.

XYZ in Max is Pitch, Roll, Heading, where as the target system applies Pitch, Heading, Roll, so it's critical to get the coordinates back as the same as the target system after the matrix transform.

So after the transform I use
CODE: quatToEuler MY_MATRIX order:2
... where 2 represents XZY

My object was 180 flipped on the X axis to, so I rotate it 180 on X before doing the quatToEuler... not sure why that happens but it works!

Credits go to Xcone, making me read the entire site helped me come up with the solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of Google's most recent algorithm changes affecting local searches is entitled "The Pigeon Update." This update has dramatically enhanced search inquires for the keyword "Yelp." Google searches with the word "Yelp" included will now yield Yelp a…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question