Left-hand coordinate system and right-hand Coordinate System

Source: Internet
Author: User

This is counted as the first article. I think it would be nice to write what I think recently when I am idle.

The left-right coordinate system is a tangle in graphics. In d3d, there are two sets of APIs in the left-right coordinate system. In OpenGL, there is the right-hand coordinate system, and in shader, the right-side coordinate system is the vector, that is, m · V is used for coordinate transformation. At this time, the translation vector is in the last column of matrix m. This is irrelevant to OpenGL column storage, some articles are written Because OpenGL columns are saved, so right multiplication is faster. I don't think this is correct. The left-hand coordinate system correspondsXXY=Z,YXZ=XThe coordinate system of the right hand is opposite to that of the rotation coordinate system.YXX=ZAnd then reverse the position of X to obtain the left-hand coordinate system.

We are actually in the left-hand coordinate system. You can consider this in this way. The right hand part corresponds to the positive direction of the X axis, the left part corresponds to the negative direction of the X axis, and the viewing direction is the positive direction of the Z axis, the direction of the sky is the positive direction of the Y axis, which is a left-hand coordinate system. In OpenGL, the corresponding API uses the right-hand coordinate system. If you manage the transformation matrix, you need to change it to the left-hand coordinate system during the viewpoint coordinate transformation. I don't talk about this in many places. I think this is very confusing for me. During the transformation, you should consider the right-hand Coordinate System in a unified way, that is, the right-hand coordinate system used in the world and model coordinates. This is a very interesting thing, in the left-hand coordinate system, it is also positive.

After reading a book that requires you to read it, you can leave here. I hope you can do what you want and make a little progress ~

Left-hand coordinate system and right-hand Coordinate System

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.