"Decompile" a transform matrix?
Hey all,
Can anyone help me understand how to break down a transform matrix into separate rotation and scale Vec3Ds?
I ask this as I'm trying to write a script that will parse LDraw Lego model files. One feature of this format is the ability to nest references to previously defined piece/geometry files inside of other files. Such a reference line looks something like this:
where these letters define the following transform matrix:
Now, for each nested piece, I'd like to (if possible) create a folder with those transform values, rather than transforming actual vertices. Getting the position is simple, but the values for rotation and scaling seem hopelessly intertwined.
Any advice would be greatly appreciated.
Hey all,
Can anyone help me understand how to break down a transform matrix into separate rotation and scale Vec3Ds?
I ask this as I'm trying to write a script that will parse LDraw Lego model files. One feature of this format is the ability to nest references to previously defined piece/geometry files inside of other files. Such a reference line looks something like this:
Code:
type color x y z a b c d e f g h i filename
where these letters define the following transform matrix:
Code:
a d g 0
b e h 0
c f i 0
x y z 1
Now, for each nested piece, I'd like to (if possible) create a folder with those transform values, rather than transforming actual vertices. Getting the position is simple, but the values for rotation and scaling seem hopelessly intertwined.
Any advice would be greatly appreciated.