/video/bv 1x 74 1 1f 744? p=2
/video/bv 1x 74 1 1f 744? p=3
After reading the previous line generation series, it is easier to read P2, and you can review it quickly at twice the speed. In P3, you can also use the transformation of base coordinates to understand those 2D transformations (the author uses special point reasoning), such as:
Reference/question /20666664/ answer/157400568, here I only extract a part.
Simply put, "affine transformation" is: "linear transformation"+"translation".
To sum up, linear transformation is realized by matrix multiplication.
Geometrically speaking, there are only two points:
The origin is unchanged.
As we said in the last section, linear transformation is realized by matrix multiplication, and affine transformation can not be realized only by matrix multiplication, but also by addition.
Reference/Question /26655998/ Answer /438472 13
Let me answer, divided into two questions:
First, we use a vector to represent a point in space: r=[rx, ry, rz]
If you want to translate, the vector of translation is: t=[tx, ty, tz]
Then the normal practice is: r+t=[rx+tx, ry+ty, rz+tz]
If homogeneous coordinates are not introduced, translation can be realized simply by 3×3 matrix multiplication. What you need to do is to find a matrix m so that rm=r+t=[rx+tx, ry+ty, rz+tz]
Then you will find that you will never find such a matrix.
So we need to introduce a new dimension, the original r=[rx, ry, rz, 1]. Then we can find a 4X4 matrix to realize translation.
In computer graphics, coordinate transformation is usually not single, and a geometric body may be designed to have multiple translation, rotation, scaling and other changes in each frame. We usually get a final change matrix by cascading various sub-change matrices, thus reducing the amount of calculation. So we need to express translation as a change matrix. So we can only introduce homogeneous coordinate system.
Understanding of Homogeneous Coordinates
I haven't fully understood the concept of aligned sub-coordinates, only to see that most books say that "homogeneous coordinates are very convenient in affine transformation", and then there is no postscript. Today, I saw an article on the discussion of perspective projection transformation on a blog called "Rebirth in Three Hundred Years", in which the alignment sub-coordinate has a very incisive explanation, especially for the sentence: "Homogeneous coordinate representation is one of the important means of computer graphics, which is not only-F.S. Hill, Jr.
Because the author really explained the alignment coordinates very well, I extracted them intact:
For a vector v and the basis oabc, we can find a set of coordinates (v 1, v2, v3) such that v = v 1 a+v2 b+v3 c (1).
For a point P, a set of coordinates (p 1, p2, p3) can be found, so that P–O = P1A+P2B+P3 C (2).
As can be seen from the above expressions of vectors and points, in order to represent a point (such as P) in the coordinate system, we regard the position of a point as the displacement from the origin O of this base, that is, the vector -P-O (some books call such a vector a position vector-a special vector starting from the origin of coordinates). While expressing this vector, we express the point P: P = O+P6 in an equivalent way.
(1)(3) is the different expression of vector and point in the coordinate system. It can be seen that although both vectors and points are expressed in the form of algebraic components, representing a point requires more information than vectors. If I write an algebraic component representation (1, 4,7), who knows whether it is a vector or a point!
We now write (1)(3) as a matrix: v = (v 1 v2 v3 0) X (a b c o).
P = (p1p2p31) x (abcco), where (a, b, c, o) is the coordinate base matrix, and the column vectors on the right are the coordinates of vector v and point p under the base respectively. In this way, vectors and points have different expressions on the same basis: the fourth algebraic component of 3D vectors is 0, while the fourth algebraic component of 3D points is 1. This way of representing 3D geometric concepts with four algebraic components is homogeneous coordinate representation.
In this way, if the above (1, 4,7) is written as (1, 4,7,0), it is a vector; If it is (1, 4,7, 1), it is a point. The following is the conversion between normal coordinates and homogeneous coordinates:
If (x, y, z) is a point, it becomes (x, y, z,1);
If (x, y, z) is a vector, it becomes (x, y, z, 0).
If it is (x, y, z, 1), it is known as a point and becomes (x, y, z);
If it is (x, y, z, 0), we know that it is a vector and still becomes (x, y, z).
That's how homogeneous coordinates distinguish vectors from points. From this, we can think that for the three most common affine transformations, translation T, rotation R and scaling S, translation transformation is only meaningful for points, because ordinary vectors have no concept of position, only size and direction.
Rotation and scaling are meaningful for both vectors and points, and you can detect them with similar homogeneous representations above. It can be seen that homogeneous coordinates are very convenient for affine transformation.
In addition, for a point P=(Px, Py, Pz) with ordinary coordinates, there is a corresponding homogeneous coordinate family (wPx, wPy, wPz, w), where w is not equal to zero. For example, the homogeneous coordinates of P( 1, 4,7) are (1, 4,7, 1), (2,8,14,2), (-0. 1,-0. So, if you change a point from ordinary coordinates to homogeneous coordinates, multiply x, y, z, y, z by the same non-zero number w, plus the fourth component w; If the homogeneous coordinates are converted into ordinary coordinates, the first three coordinates are divided by the fourth coordinate at the same time, and then the fourth component is removed.
Homogeneous coordinates use four components to represent the concept of 3D, so that translation transformation can be carried out by matrix, which is more convenient for affine (linear) transformation, as F.S. Hill Jr. said. Because graphics hardware has generally supported homogeneous coordinates and matrix multiplication, it has promoted the use of homogeneous coordinates and made it look like a standard in graphics.
This design is perfect, which ensures that the calculation in the following figure is still meaningful:
In the above figure, adding another point to one point will result in the end of two points, because w= 1+ 1=2.
Now, the transformation in homogeneous coordinates is as follows:
Is the picture above easy to understand? (x, y, 1) represents a variable in homogeneous coordinates, rotated 45 degrees by left multiplication, and then translated by left multiplication.