?/TD> |

Microsoft DirectX 9.0 |

Multiplies two quaternions.

Syntax

D3DXQUATERNION *D3DXQuaternionMultiply(

D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2);

Parameters

pOut- [in, out] Pointer to the D3DXQUATERNION structure that is the result of the operation.
pQ1- [in] Pointer to a source
D3DXQUATERNIONstructure.pQ2- [in] Pointer to a source
D3DXQUATERNIONstructure.

Return Value

Pointer to a

D3DXQUATERNIONstructure that is the product of two quaternions.

Remarks

The result represents the rotation Q1 followed by the rotation Q2 (Out = Q1 * Q2). This is done so that

D3DXQuaternionMultiplymaintain the same semantics as D3DXMatrixMultiply because unit quaternions can be considered as another way to represent rotation matrices.Transformations are concatenated in the same order for both the

D3DXQuaternionMultiplyandD3DXMatrixMultiplyfunctions. For example, assuming mX and mY represent the same rotations as qX and qY, both m and q will represent the same rotations.D3DXMatrixMultiply(&m, &mX, &mY); D3DXQuaternionMultiply(&q, &qX, &qY);The multiplication of quaternions is not commutative.

The return value for this function is the same value returned in the

pOutparameter. In this way, theD3DXQuaternionMultiplyfunction can be used as a parameter for another function.

Function Information

Header d3dx9math.h Import library d3dx9.lib Minimum operating systems Windows 98

See Also

D3DXMatrixMultiply