In the Transform3D class there are several methods that set a scale value. For instance the following:
/**
* Sets the rotational component (upper 3x3) of this transform to the
* values in the specified matrix. The other elements of this transform
* are unchanged. An SVD (singular value decomposition) is performed
* on this object's upper 3x3 matrix to factor out the scale, then this
* objects upper 3x3 matrix components are replaced by the input
* rotational components, and finally the scale is reapplied to the
* rotational components.
*/
public final void setRotation(Matrix3f m)
So what exactly is happening here? Is it the following steps:
1> Each element of the upper 3x3 matrix of the transform is being divided by the scale, and put back into the matrix.
2> Replace the elements in the upper 3x3 matrix with the new values from m.
3> Multiply the upper 3x3 matrix elements by the scale and replace the values.
If so what is the point of step number 1? If not then I’m obviously not understanding what SVD does and can someone explain it and/or show me some pseudo code?
Thanks.