[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

3D Coordinate Translation

Posted on 2009-04-10
3
Medium Priority
?
1,152 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 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The greatest common divisor (gcd) of two positive integers is their largest common divisor. Let's consider two numbers 12 and 20. The divisors of 12 are 1, 2, 3, 4, 6, 12 The divisors of 20 are 1, 2, 4, 5, 10 20 The highest number among the c…
Iteration: Iteration is repetition of a process. A student who goes to school repeats the process of going to school everyday until graduation. We go to grocery store at least once or twice a month to buy products. We repeat this process every mont…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
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…

649 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