Matrix.Decompose Method
Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.
Syntax
'Declaration
Public Function Decompose ( _
out scale As Vector3, _
out rotation As Quaternion, _
out translation As Vector3 _
) As Boolean
public bool Decompose (
out Vector3 scale,
out Quaternion rotation,
out Vector3 translation
)
public:
bool Decompose(
out Vector3 scale,
out Quaternion rotation,
out Vector3 translation
)
Parameters
- scale
Type: Vector3
[OutAttribute] The scalar component of the transform matrix, expressed as a Vector3. - rotation
Type: Quaternion
[OutAttribute] The rotation component of the transform matrix, expressed as a Quaternion. - translation
Type: Vector3
[OutAttribute] The translation component of the transform matrix, expressed as a Vector3.
Return Value
Type: Boolean
true if the Matrix can be decomposed; false otherwise.
Example
The following example illustrates how to recompose the matrix from the extracted components.
Matrix m = Matrix.CreateScale(scale) * Matrix.CreateFromQuaternion(rotation) * Matrix.CreateTranslation(translation);
Requirements
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Windows Phone