# Need help with coordinate system transformations

This topic is 1114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

After working on this for days now and still having some issues with it, I'm afraid I might need some help.

Ok my setup looks like the following:

I'm using a tracking system (Motive) with four cameras to receive positional data from markers and rigid bodies.

That data is in trackingCoordinateSpace and I need it transformed to openGLCoordinateSpace, so that (0,0,0) is at the center of my display.

I tried to illustrate it...

Ok so I calculate my X,Y,Z axis from markers fixed on three corners of my display, like shown in the picture, I calculate then center of the display (lets name it centroid) and I calculate the scale from one coordinate system to the other.

I then go from tracking system coordinates to OpenGL coordinates with this transformation matrix:

Is that correct so far?

I'll leave it at that for now, so it doesn't get too confusing. I'll have another question once this is solves though.

##### Share on other sites

direct creation of the matrix is one approach.

simply applying the appropriate transforms is another perhaps more intuitive approach. either way you should get the same resulting transform matrix.

assuming your two coordinate systems are axis aligned, the transforms should be something like scale(s,s,s), followed by translate(dx,dy,dz).  this would scale mocap coords to world coords, then translate the mocap origin to the world origin. note that the translate distances would be in world coords, not mocap coords.

Edited by Norman Barrows

##### Share on other sites

Thank you for the answer. However the coordinate systems are not axis aligned, so I need a rotation as well. As you can see, right now im translating first, then scaling and the rotating (hopefully with the correct matrix?).

Is the code I've posted above correct?

Hmm no one? :/

##### Share on other sites

Your question is quite vague (" is this right so far?" )  so without knowing a concrete issue that you are having a problem with I'm unable to provide any help. Have you tried adding in the rotation? Generally transforms are concatenated in the order of scale, rotate, than transform.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 76
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632968
• Total Posts
3009585
• ### Who's Online (See full list)

There are no registered users currently online

×