The orientation is the direction position, the object "direction", the direction of the object, such as a person in the 3D space, can be facing you, or the sky. Intuitive imagination, each object has 6 degrees of freedom, representing the X, Y, Z coordinate, and the angle of rotating around X, Y, Z axis, easy to think, can use three numbers to describe an object direction. The Eura is a description method using three numbers. Generally, in the case of "Heading-Pitch-Bank", "Heading" is rotated around the Y-axis, to the right "Pitch" is rotated around the X-axis and is positive, "Bank" is rotated around the Z-axis, looking forward from the origin to Z, counterclockwise is positive. It should be noted that these rotated X, Y, Z axes are axes of the object coordinate system. The Eura is only used to describe the direction, and 3 numbers are angles, so it is relatively easy to use for us, and the expression is also simpler (no extra data), any three numbers are legal, so Calculation error accumulation is not much affected by Euler. When the Euler angle expresses the same direction, there may be an endless representation (like the X half loop and 1 turn is half a half), in order to uniquely, we define Heading and Bank between 180 degrees to -180 degrees. PITCH is limited between 90 degrees to -90 degrees. Even if this specified, the direction of the direction is not only unique, and there is a so-called "universal lock" problem, first Heading 45 degrees and then PITCH 90 degrees and first PITCH 90 degrees and then BANK 45 degrees, so the regulations occur When the lock problem (Pitch 90), the rotation is completed by Heading, and the bank is 0. The Euler angle is more troublesome. If you do not limit the Euler angle, use a simple interpolation calculation, it will rotate too much, 720 and 45 degrees are only 45 degrees, but simple interpolation operations will cause the turning circle. Even if the Euler angle is used, the only phase difference between -170 degrees and 170 degrees, but the simple interpolation will rotate 160 degrees, and the difference between the two countries must be limited to 180 degrees. Finally, when encountering a universal lock, it will encounter a more difficult problem, most of which will cause jitter and path errors, this is a bottom problem, almost inevitable. The four-dimensional number can be seen as an imaginary number in 3D in 3D, which is directed by four numbers, thereby avoiding some of the Issue of Euler. The general representation is [W, V] or [W, (X, Y, Y, Z)] (Note: The x, y, z coordinate, bold indication vector here).
Ou proves that any rotation can be represented by a single rotation of an axis, so the direction can be decomposed into an angle (θ) axis (n), but this angle and axis is not simple in the four-component number, Their relationship is as follows: q = [θ / 2), sin (θ / 2) n] = [COS (θ / 2), (SiN (θ / 2) x, sin (θ / 2) Y, SiN (θ / 2) z)] Like the quad number, you can do , seek, ratings, fork, etc., is quite simple for the quadrant of the four-element number (Slerp), and will not encounter 10,000 To the lock problem. It also quickly connects and rapidly converts quickly and matrix. It uses only 4 numbers. The problem of four-yuan is that it has used a number than the Euler-angle (more space), and the four-yuan number may not legal (can solve this problem by solving the four-dimensional markup), it is difficult to use directly. Finally, you can also save the orientation with a matrix of 3 * 3. He can immediately rotate the vector, and is directly supported by the graphic API. Multiple angular displacement can be connected, and the inverse of the matrix is also simple, but it takes too much memory. It is difficult to use and may be sick. The scaling, cut, or mirroring operation of the matrix may result in undefined behavior of the direction, resulting in a pathological matrix. Bad data sources, such as physical acquisition devices, may transmit error data, resulting in pathological matrices. Since the calculation accuracy of floating point numbers is limited, a large number of matrix multiplication may cause matrix creep, and finally produce a path-state matrix (which can be intertwined by matrix to solve this creep). In general, and human interaction (such as design objects in 3DS) can be used to save (especially a large number of orientations, such as animation), can consider the Eu Rock and four-dimensional, smooth rotation (linear interpolation) It is best to use a quad number, and use a matrix when performing multiple calculations and connectivity. Reference: "3D Mathematical Basics: Graphics and Game Development" (US) Fletcher Dunn, Ian Parberry, Tsinghua University Press
PS: This book is a 3D mathematical knowledge of entry-level books. To see this book, this book helps a lot of concepts.