Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XMMatrixDecompose method

Breaks down a general 3D transformation matrix into its scalar, rotational, and translational components.


bool XMMatrixDecompose(
  [in, out] XMVECTOR  *outScale,
  [in, out] XMVECTOR  *outRotQuat,
  [in, out] XMVECTOR  *outTrans,
  [in]      XMMATRIX  M


outScale [in, out]

Pointer to the output XMVECTOR that contains scaling factors applied along the x, y, and z-axes.

outRotQuat [in, out]

Pointer to the XMVECTOR quaternion that describes the rotation.

outTrans [in, out]

Pointer to the XMVECTOR vector that describes a translation along the x, y, and z-axes.

M [in]

Pointer to an input XMMATRIX matrix to decompose.

Return value

If the function succeeds, the return value is true. If the function fails, the return value is false.


XMMatrixDecompose provides the same basic functionality found in both D3DXMatrixDecompose (Direct3D 9) and D3DXMatrixDecompose (Direct3D 10).

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.



Use DirectX.



See also

DirectXMath Library Matrix Functions



© 2017 Microsoft