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
- 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.
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.