Is there a way in MatLab to extract scale, rotate and translate from a 4x4 transform matrix taken from Maya?

7 views (last 30 days)
Ok, so I'm specifically wanting to take the rotate X, Y and Z from the transform matrix but I would presume (as the matrix hold all the info) that someone has come up with a way to read the matrix and return the values held within.
The translation order in Maya is scale, rotate, translate. Default rotation order is XYZ
I'm not sure if this link helps at all if anyone can make sense of it?

Answers (1)

Matt J
Matt J on 4 May 2013
If you have a 4x4 matrix that you want to decompose, you could use this
E=absor(eye(4), your4x4);
  2 Comments
Lennart
Lennart on 26 Jan 2015
A =
0.1953 0 0 -140.8863
0 0.1952 0.0612 -127.8713
0 -0.0060 1.9991 -0.3536
0 0 0 1.0000
>> absor(eye(4),A)
Error using absor (line 228)
Points must be either 2D or 3D
Matt J
Matt J on 26 Jan 2015
Edited: Matt J on 26 Jan 2015
Hmmm. Don't know what I was thinking, there. But I believe this should fix it
target=bsxfun(@plus,A(1:3,1:3),A(1:3,end));
source=eye(3);
E=absor(source, target,'doScale',1);
Also, I was assuming a uniform scaling in X,Y,Z.

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!