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 (in microsoft.xna.framework.dll)

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

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);
    

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone

Community Additions

ADD
Show:
© 2014 Microsoft