I understand how it works and that it can compute the rotation and scale, and I am aware that these are the rotation and the scale that are the best guess of the algorithm and I'm cool with it.
But when I try to calculate a scale matrix from a matrix M, that has a lot of transformations stored in it, like, a lots of rotations, scales and shears, and God knows in what order are those applied, I can't get the matrix that looks like a scale matrix or even reminds of it. I can get the rotation matrix, for which I know that it is not the original rotation, but the "guessed" rotation.
Let me give you an example:
I have a rotation, scale and a shear (skew) matrices:
R = [ 0.86603 -0.5; 0.5 0.86603 ]
Scale = [ 2 0; 0 3 ]
Shear = [ 1 0.3; 0.6 1 ]
And if I apply them like this:
M = Shear * Scale * R
and run the left polar decomposition on the matrix M that calculates M = Scale * Rotation i get these results:
Rotation = [ 0.80028 -0.59962; 0.59962 0.80028 ] I checked, and this is rotation matrix
Scale = [ 1.8785 1.1319; 1.1319 3.1573 ]
and if I run the right polar decomposition I get these results:
Rotation = [ 0.80028 -0.59962; 0.59962 0.80028 ]
Scale = [ 3.42462 0.93162; 0.93162 1.61125 ]
As you can see none of those Scale matrices from left or right polar decomposition is a real scale matrix or even close to one.
Is that because the shear transformation is applied, or is it something else that I am missing?
I would really appreciate if someone could shine some light for me on this one.
Note: I computed these matrices using Octave and my own implemetation of the polar decomposition algorithm just to be safe that the results are valid.
Best regards!