| Matrix44FDecompose Method (Vector3F, Matrix33F, Vector3F) |
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 Vector3F scale,
out Matrix33F rotation,
out Vector3F translation
)
Public Function Decompose (
<OutAttribute> ByRef scale As Vector3F,
<OutAttribute> ByRef rotation As Matrix33F,
<OutAttribute> ByRef translation As Vector3F
) As Boolean
public:
bool Decompose(
[OutAttribute] Vector3F% scale,
[OutAttribute] Matrix33F% rotation,
[OutAttribute] Vector3F% translation
)
member Decompose :
scale : Vector3F byref *
rotation : Matrix33F byref *
translation : Vector3F byref -> bool
Parameters
- scale
- Type: DigitalRune.Mathematics.AlgebraVector3F
The scale component of the matrix. - rotation
- Type: DigitalRune.Mathematics.AlgebraMatrix33F
The rotation component of the matrix. - translation
- Type: DigitalRune.Mathematics.AlgebraVector3F
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(Vector3F, Matrix33F, Vector3F) 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(Vector3F, Matrix33F, Vector3F) 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.
Matrix33F sr = rotation * Matrix33F.CreateScale(scale);
Matrix44F srt = new Matrix44F(sr, translation);
See Also