Quaternion.Multiply Method |
Language: |
Multiplies two quaternions.
Visual Basic Public Shared Function Multiply( _
ByVal m1 As Quaternion, _
ByVal m2 As Quaternion _
) As QuaternionC# public static Quaternion Multiply(
Quaternion m1,
Quaternion m2
);C++ public:
static Quaternion Multiply(
Quaternion m1,
Quaternion m2
);JScript public static function Multiply(
m1 : Quaternion,
m2 : Quaternion
) : Quaternion;
m1 Microsoft.DirectX.Quaternion
Source Quaternion structure.m2 Microsoft.DirectX.Quaternion
Source Quaternion structure.
Microsoft.DirectX.Quaternion
A Quaternion structure that is the product of two quaternions.
The result represents the rotation m1 followed by the rotation m2 (return value = m1 * m2). This is done so that Multiply maintains the same semantics as Matrix, because unit quaternions can be considered as another way of representing rotation matrices.
Transformations are concatenated in the same order for the Quaternion.Multiply and Matrix.Multiply methods. In the following C# code example, assuming that mX and mY represent the same rotations as qX and qY, both m and q represent the same rotations.
[C#]The multiplication of quaternions is not commutative; that is, the order in which they are multiplied is important.
m = Matrix.Multiply(mX, mY); q = Quaternion.Multiply(qX, qY);
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center