?
Solved

3D Coordinate Translation

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Nadia
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your U…
Article by: Nadia
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

777 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