I. Matrix
In 3D games, a matrix can be used to represent the rotation of an object.
1) Advantages:
In my opinion, it is the most intuitive to understand.
Similar to the existing dxsdk library, related interfaces are also provided.
A matrix represents a combination of multiple transformations.
2) Disadvantages:
Errors are generated during each calculation. Therefore, normalization is required frequently.
More memory consumption.
Ii. ouarla
Ouarla refers to the reference coordinate system based on the world coordinate system (the World coordinate system must be remembered). The X, Y, and Z values are used to represent the circle (the World) respectively) X axis, Y axis, and Z axis rotation angle value. The value range is [0,360. Roll, pitch, and yaw are generally used to represent the rotation values of these components. Because the reference coordinate system is the world coordinate system, every rotation will not affect the subsequent rotation axis. That is, it cannot represent the rotation of any axis.
1) Advantages:
It is intuitive to understand.
2) Disadvantages:
There will be a problem with universal locks.
Iii. Axis-angle Pairs
In fact, there is a certain relationship between the axis-angle pair and the Orla hora (in my opinion. This is because ouarla angles refer to the following (Note: they are respectively) rotation angles of the three axes (taking the world coordinate system as the reference coordinate system. In fact, the three rotations can be eventually converted to one transformation. That is, it can be expressed as a transformation of rotating a certain angle around a certain axis of rotation. (That is to say, we can finally calculate the rotation axis and the angle of rotation around the rotation axis ).
1) Disadvantages:
Axis-angle pair Notation: the interpolation is not smooth and may jump. (As mentioned in the document, this problem also exists in ouarla)
2) Advantages:
It can solve the problem of universal lock in the ouarla corner.
Iv. Quaternary
Definition of the Quaternary element: q = W + Xi + YJ + ZK
Note:
1) The Quaternary can be normalized, and rotation is described only by the normalized Quaternary.
(2) The relationship between the element 4 and the axis-angle pair is similar. This is because the Quaternary element describes a rotation axis and a value (angle or radian) that rotates around the rotation axis ). However, there is no equivalent relationship between the Quaternary element and the axis-angle pair. Their relationships are as follows:
Assume that the value of the Axis-angle pair is as follows:
Axis: N
Theta
Then, the values of W, X, Y, and Z in the corresponding element are:
W = cos (theta/2)
X = NX * sin (theta/2) // NX is the X component of axis n.
Y = Ny * sin (theta/2) // NY is the Y component of axis n.
Z = NZ * sin (theta/2) // NZ is the Z component of axis n.
3) multiplication of the Quaternary element:
q = Q1 * Q2 indicates that Q is first rotated by Q2 and then rotated by Q1, in addition, the rotation of multiple Quaternary elements must be merged.
4) perform 16 multiplication and addition for a single multiplication of the Quaternary element, whereas 27 for the 3x3 matrix. Therefore, when there are multiple rotation operations, it is more efficient to use the Quaternary element.
5) Over-smooth interpolation of the Quaternary element. Linear interpolation is commonly used.