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