Matrix.Decompose Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Extracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

Syntax

'Declaration
Public Function Decompose ( _
    <OutAttribute> ByRef scale As Vector3, _
    <OutAttribute> ByRef rotation As Quaternion, _
    <OutAttribute> ByRef translation As Vector3 _
) As Boolean
public bool Decompose(
    out Vector3 scale,
    out Quaternion rotation,
    out Vector3 translation
)

Parameters

Return Value

Type: System.Boolean
true if the Matrix can be decomposed; false otherwise.

Examples

The following example illustrates how to recompose the matrix from the extracted components.

Matrix m = Matrix.CreateScale(scale) *
    Matrix.CreateFromQuaternion(rotation) *
    Matrix.CreateTranslation(translation);

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.