Transformation (1) (notes)


1. Two-dimensional transformation

Linear transformation and matrix : Insert picture description here
linear transformation = matrix (matrix with the same dimensions as the vector)

Scaling : Insert picture description hereUniform scaling and Insert picture description herenon-uniform scaling

Symmetry (Reflection) : Insert picture description herex becomes -x, y does not change.

Shear : Just Insert picture description herelike dragging the image in the horizontal direction, there is no change at the position of y=0 in the horizontal direction, and it changes to a at the position of y=1 in the horizontal direction. The movement of any point in the horizontal direction is a*y, and there is no change in the vertical direction.

Rotate : Insert picture description hereInsert picture description hereGenerally speaking, the default rotation is to rotate around the origin of the coordinate, and the counterclockwise direction is the positive direction. The derivation process is to obtain the transformation matrix through two special points (1,0), (0,1).

Translate : Insert picture description hereTranslate is special and cannot be expressed in matrix form and is not a linear transformation. But we don't want the translation transformation to be special, so we introduce homogeneous coordinates to solve the problem.

2. Homogeneous Coordinates

Homogeneous Coordinates : Insert picture description hereInsert picture description hereAdd the third coordinate (w coordinate), and the following matrix will become the above form. Since the vector does not consider the absolute position (translation invariance), adding the third coordinate is 0 to ensure the same after the change and before the change.

Affine Transformations : Insert picture description hereAffine map = linear mapping + displacement. All affine transformations can be transformed into homogeneous coordinate transformations. Only when representing the mode transformation in two-dimensional coordinates, the last line is 0 0 1.

The unified form of transformation : the Insert picture description herehomogeneous coordinate form can be used to represent all transformations.

Inverse Transform : Insert picture description hereReverse the operation of a transform is an inverse transform, which is mathematically multiplied by the inverse matrix of the transform matrix.

Composite Transform : Insert picture description hereThe transformation order of the composite matrix is ​​very important. For the composite transformation, different results will usually be obtained after the transformation order is changed. That is, for combinatorial transformation, the commutative law is not satisfied. Insert picture description hereNote that for the combination transformation formula, the calculation is from right to left.

2. 3D Transforms (Preview)

3D Transforms : Insert picture description hereUse homogeneous coordinates again, and use 4 parameters to represent the 3D transformation. In other words, (x, y, z, w) (w != 0) is used to represent points (x/w, y/w, z/w) in three-dimensional space.

Three-dimensional affine transformation : Insert picture description hereA 4 X 4 matrix is ​​used to represent the three-dimensional affine transformation, the last row is 0 0 0 1, the first three numbers in the last column are displacements, and abcdefghi is a linear transformation in three-dimensional space.


The end of the course

Insert picture description here
Does it mean translation or linear transformation first?
It should be linear transformation first and then translation.

Guess you like

Origin blog.csdn.net/qq_37856544/article/details/112847828