Conversion Between the Quaternary element and the angle-and-axis pair

Source: Internet
Author: User

In 3D graphics, the most common rotation representation method is the four-element and the Euclidean angle, which saves storage space and facilitates interpolation compared with the matrix. This article mainly summarizes the conversion of two expressions. The calculation formula uses the 3D Cartesian coordinate system:

Figure 1 3D Cartesian coordinate system (from Wikipedia)

It is defined as the rotation angle around the Z axis, Y axis, and X axis respectively. If Tait-Bryan angle is used, the rotation angles are yaw, pitch, and roll.

Figure 2 Tait-Bryan angles (from Wikipedia)

I. Definition of the Quaternary Element

By rotating the axis of rotation and the angle around the axis, You can construct a four-element system:

The rotation angle around the rotating axis is the component of the rotating axis in the direction of X, Y, and Z (the rotating axis is determined ).

Ii. Conversion from orah to Quaternary

Iii. Conversion from a quaternary element to an ouarla corner

ArctanAndArcsinThe result is that this does not cover all orientations (the value range for the angle has been satisfied), so you need to useAtan2To replaceArctan.

4. Use in other Coordinate Systems

In other coordinate systems, adjust the above formula according to the definition of the coordinate axis. For example, in direct3d, the X axis of the Cartesian coordinate system is changed to the Z axis, the Y axis is changed to the X axis, and the Z axis is changed to the Y axis (you do not need to consider the direction ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.