3D Track Data Converter

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  01 January 2004
Question 3D Track Data Converter

I have a question for you folks. I'm writing a converter to translate 3D Tracking Data to and from MaxScript. I noticed in some sample data that a camera's rotation is represented by a 4x3 matrix (4 rows x 3 elements per row) with the last row being filled with 0's, possibly making it essentially a 3x3 matrix. Can anyone tell me what this matrix represents and maybe give me a pointer to converting this matrix in to a rotation represented by degrees or radians.

The script looks something like this at the point which I am talking about.

c = camera()
at time 0f c.rotation = (matrix3 [[0.003, 0.010, 0.000] [0.003, 0.002, 0.001] [0.001, 0.013, 0.002] [0, 0, 0]])

Thanks a lot.

Bart Robinson
  01 January 2004
Transform matrices are a complex subject, and require an understanding of higher mathematics that I do not possess. Nonetheless, there are some things I understand about them, and how to apply them. In short, the transform matrix contains all the information needed to express the orientation (rotation), scale, and position of an object in 3D space. Transformations occur when a matrix is multiplied by another matrix. In the 4x3 matrix used in Maxscript, the fourth row represents the translation.

Since a matrix3 represents all of rotation, scale, and position, the statement $obj.rotation = tm (where tm is a matrix3 value) is actually casting tm to a quat for assignment to the rotation property of obj. In other words, it's pulling just the rotation part out of the matrix and then assigning that to $obj.rotation. You can manually extract the rotation by using rot = tm as quat or rot = tm as eulerAngles, or get it as a quat by simply stating rot = tm.rotation

If you really want to get into the hardcore details of transform matrices, there's plenty of information out there on the web and in math books at your local library. But in order to successfully apply them you really don't need to know much about how they work "under the hood." I'm afraid that's all the more helpful I can be on this subject

Got Maxscript?
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:43 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.