Export (0) Print
Expand All

Matrix.Decompose Method

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)

public bool Decompose(
	out Vector3 scale,
	out Quaternion rotation,
	out Vector3 translation
)

Parameters

scale
Type: Microsoft.Xna.Framework.Vector3%
[OutAttribute] The scalar component of the transform matrix, expressed as a Vector3.
rotation
Type: Microsoft.Xna.Framework.Quaternion%
[OutAttribute] The rotation component of the transform matrix, expressed as a Quaternion.
translation
Type: Microsoft.Xna.Framework.Vector3%
[OutAttribute] The translation component of the transform matrix, expressed as a Vector3.

Return Value

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

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

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

Silverlight

Supported in: 5

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

Community Additions

ADD
Show:
© 2014 Microsoft