| Matrix44DDecompose Method (Vector3D, Matrix33D, Vector3D) |
Decomposes the matrix into the scale, translation, and rotation components.
Namespace: DigitalRune.Mathematics.AlgebraAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public bool Decompose(
out Vector3D scale,
out Matrix33D rotation,
out Vector3D translation
)
Public Function Decompose (
<OutAttribute> ByRef scale As Vector3D,
<OutAttribute> ByRef rotation As Matrix33D,
<OutAttribute> ByRef translation As Vector3D
) As Boolean
public:
bool Decompose(
[OutAttribute] Vector3D% scale,
[OutAttribute] Matrix33D% rotation,
[OutAttribute] Vector3D% translation
)
member Decompose :
scale : Vector3D byref *
rotation : Matrix33D byref *
translation : Vector3D byref -> bool
Parameters
- scale
- Type: DigitalRune.Mathematics.AlgebraVector3D
The scale component of the matrix. - rotation
- Type: DigitalRune.Mathematics.AlgebraMatrix33D
The rotation component of the matrix. - translation
- Type: DigitalRune.Mathematics.AlgebraVector3D
The translation component of the matrix.
Return Value
Type:
Boolean if the matrix was successfully decomposed; otherwise,
.
Remarks
This method assumes that the matrix is a 3D scale/rotation/translation (SRT) matrix.
Decompose(Vector3D, Matrix33D, Vector3D) returns
when the matrix is not a valid SRT matrix. This is the case when two
or more of the scale values are 0 or the last row of the matrix is something other than
(0, 0, 0, 1).
DecomposeFast(Vector3D, Matrix33D, Vector3D) is a faster version of
this method that can be used when it is certain that the matrix is a valid SRT matrix.
Examples
The following example shows how to compose the matrix scale, rotation, and translation
components.
Matrix33D sr = rotation * Matrix33D.CreateScale(scale);
Matrix44D srt = new Matrix44D(sr, translation);
See Also