# 3D Track Data Converter

 01 January 2004 bartrobinson Frequenter   portfolio Bart Robinson Special Effects Artist Dynavision|FX Fairfax, USA 3D Track Data Converter Hey, 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 Dynavision|FX share quote
 01 January 2004 LFShade smarter than I look   for sale or rent! 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 RH __________________ Got Maxscript? RHTools share quote
 01 January 2006 CGTalk Moderation Expert 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. share quote

 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 CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.