Difference and connection between the right-hand coordinate system

Source: Internet
Author: User
Tags cos sin

This paper is an analysis of what the so-called right-hand coordinate system needs to be converted to left-handed coordinates:

The z axis is reversed; The x axis is reversed (or the camera position is changed); The rendering around the order changes, in which the further reason.


Https://msdn.microsoft.com/en-us/library/bb204853%28VS.85%29.aspx

http://blog.csdn.net/augusdi/article/details/20450691
One or three angular grid data
1. Triangular mesh vertex data changes remember the left-hand coordinate system is the camera coordinate system is the z-Axis square in the west, in the right-hand coordinate system, the camera coordinate system is in the negative side of the z axis, so: 1 Classic: The right hand coordinate system is converted to the left hand when it needs triangular grid data z-Axis Flip 2) Art software: 3DS The Max is y-z to flip each other, for example:

A careful analysis of the above process, the problems we face can be divided into two levels, one is the skeleton computing level, and the other is the model mapping level. The real right thing to do is to not confuse the two and have to make a strict distinction between their processes, that is, the calculation should not take into account the problem of the right-hand-hand system facing the drawing, and vice versa.
The rotation matrix in 3ds Max that converts data to a left-handed coordinate system.

(1 0 0 0) (0 0 1 0) (0 1 0 0) (0 0 0 1)
Why is that? Render time should be the z-axis, z to get the vertex coordinates, and then render the back of the rendering, set the camera and projection transformation to the left hand coordinate system can be. Since this is plotted from 3DS Max's right-hand coordinate system (Y-Z Upward) to the left-handed coordinate system, the triangular grid data seen in the max is converted to the grid data in the D3D.
3 to observe the position caused by the positive and negative-camera position change or X-value flip also note that because the view coordinate system Z axis changes, if the camera coordinate system changes but the observation position does not change, then the X value needs to flip (if the camera position is properly changed then do not need).
2. When rendering, triangular grid index data change render time because of the plane's judgment, the left-hand coordinate system is clockwise to the front, the right hand coordinate system counterclockwise is positive.
3. When rendering, the triangular grid UV coordinate system if the order of the drawing is changed positively, then the UV coordinates also want to change with the index cache.
The transformation of the round order and the positive-cross product and rotation data is changed by 4. Cross-product vectors and rotational data change vector forks will change, the rotation of the West will change; therefore, the previously deposited normal vector, because the vertex changes need to calculate, select the matrix or four of dollars to change.
For example: A. In the left hand system, the rotation axis vector is n, clockwise rotating T, then there are:
Q=[cos (T/2) sin (T/2) n]
Q=[cos (T/2) sin (t/2) nx sin (t/2) ny sin (T/2) NZ]
Q=[w x y z]
B. In the right hand system, the rotation axis vector is n and the inverse clock rotates t, then there are:
Q=[cos (T/2) sin (T/2) n]
Q=[cos (T/2) sin (t/2) nx sin (t/2) ny sin (T/2) NZ]
Q=[w x y z]
It can be found that the only difference is that the rotation of the angle T in the right-hand system is the opposite. Quarternion four components, the back x/y/z three components in different coordinate systems should be symbolic reciprocal.
That is, the four-dollar number stored in 3DS Max converts to the inverse of the four-dollar number in the D3D, because the rotation angle has not changed.

Differences between view and perspective projection coordinate systems
5. In the view coordinate system, the triangle transformation in the local and the world coordinate system can the view coordinate system needs to be aware that the right hand definition is eye-at to Z axis and is rendered in Z-direction, while the left hand is at-eye to the z-axis and renders to the z-axis, which may need to be changed; The ogl right-hand coordinate system in perspective projection is to place Z in the [the right-hand coordinate system in -1,1],D3D places z in the [0,1].

Get reference position differences: Also note that because of the change in the view coordinate system Z axis, if the camera coordinate system changes but the observation position does not change, then the X value needs to be flipped (if the camera position is properly changed then it is not necessary).
Expanding the nature of the existence and transformation of coordinate systems: the essence of the right-hand coordinate system is the 24 coordinate system of the left hand and the 24 coordinate system of the right hand in the 6 * 4 * 2=48 in the cross-dimensional coordinate system because of the difference of the cross-multiplication definition. The two-dimensional 4 * 2 = 8 species can be represented by a standard Cartesian cross coordinate system because they rotate the plane from the opposite side. In the 3 dimension, because there is no more one dimension to observe the rotation, so no matter how to flip the rotation, you will get two different coordinate systems, do not make a forced reversal of the change (irregular rotation) then it is not possible to transform from a coordinate system to a coordinate systems, so need to coordinate the transformation between the need for mandatory conversion , such as z-axis inversion, z-y interchange, etc.

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.