Sign in to follow this  

Need help with coordinate system transformations

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

If you intended to correct an error in the post then please contact us.

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...

a682db7124f3a57facc49a7601e141ba.png

 

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:

f19de59ef725b099d9cdda80317d17eb.png

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 this post


Link to post
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 this post


Link to post
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?

Share this post


Link to post
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.

 

 

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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