UE4 coordinate transformation operation

> The order of rotation is important. Different rotation sequences may result in different results.

In the above figure, A and B are two rotation axes perpendicular to the screen, and X is the object. First, rotate X 90° counterclockwise around the A axis, and then 90° counterclockwise around the B axis, then X will return to the beginning. place.

In the above figure, if X is rotated 90° counterclockwise around the B axis, and then rotated 90° counterclockwise around the A axis, then X will eventually move to X'''.

> FRotator, FTransform, and FMatrix multiplication all use the transformation on the left first, and then the transformation on the right. FQuaternion multiplication is to apply the transformation on the right first, and then the transformation on the left. It is stipulated that the following transformations are expressed in the form of FTransform.

> If there is a world system transformation A, and there is another world system transformation B, assuming that the world system transformation increment required to transform from A to B is D, then A * D = B. Another most important example: the parent node world system is transformed to P, the child node world system is transformed to C, and D is the world system transformation from P to C, then P * D = C. Let L be the local transformation of the child node under the parent node, because P is the coordinate transformation from the parent node to the world system, so L * P = C, the understanding is that when the parent node has no initial transformation, L is the world system transformation of the child node Description, at this time, when the parent node performs P transformation, it will drive the child node to perform the same world system transformation P. At this time, the world system transformation of the child node C = L * P. Note the difference between D and L here, they are different coordinate system transformation descriptions, D is the world system transformation, and L is the local system transformation. The meaning and usage of these two equations is the most important thing in UE4's coordinate transformation, and it must be clarified.

There is also an application that logically regards the child node as the parent node. When changing the child node, the parent node performs the same transformation with the child node. In this case, the relative relationship between the parent node and the child node is unchanged, that is, The L mentioned above is fixed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324410346&siteId=291194637