Microsoft DirectX 8.1 (Visual Basic) |
D3DXQuaternionMultiply( _ QOut As D3DQUATERNION, _ Q1 As D3DQUATERNION, _ Q2 As D3DQUATERNION)
If the function fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DERR_OUTOFVIDEOMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
The result represents the rotation Q2 followed by the rotation Q1 (Out = Q2 * Q1). The output is actually Q2*Q1 (not Q1*Q2). This is done so that D3DXQuaternionMultiply maintain 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 D3DXQuaternionMultiply and D3DXMatrixMultiply functions. 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.