Share via


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

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