| Matrix44DDecompose Method (Vector3D, QuaternionD, 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 QuaternionD rotation,
out Vector3D translation
)
Public Function Decompose (
<OutAttribute> ByRef scale As Vector3D,
<OutAttribute> ByRef rotation As QuaternionD,
<OutAttribute> ByRef translation As Vector3D
) As Boolean
public:
bool Decompose(
[OutAttribute] Vector3D% scale,
[OutAttribute] QuaternionD% rotation,
[OutAttribute] Vector3D% translation
)
member Decompose :
scale : Vector3D byref *
rotation : QuaternionD byref *
translation : Vector3D byref -> bool
Parameters
- scale
- Type: DigitalRune.Mathematics.AlgebraVector3D
The scale component of the matrix. - rotation
- Type: DigitalRune.Mathematics.AlgebraQuaternionD
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, QuaternionD, 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, QuaternionD, 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.
Matrix44D srt = Matrix44D.CreateTranslation(translation)
* Matrix44D.CreateRotation(rotation)
* Matrix44D.CreateScale(scale);
See Also