When I was a beginner at 3d, a concept had plagued me for a long time: What is vertex and what is vector ??
In the program, vertices and vectors are represented by the same type. Even discussed with others, the two are also mixed, so they were confused in the beginning.
In fact, vertices and vectors are different concepts.
Vertex: the location information in the space, that is, the coordinates of X, Y, and Z. It is usually represented by a triple (x, y, z, the transformation may be extended to homogeneous coordinates (x, y, z, W). In this case, W is extended for convenience of matrix calculation. Generally, W is 1. after the conversion, W may become a non-1 value. In this case, you need to perform the normalization action (x/W, Y/W, Z/W, w/w ), the geometric meaning of this action is to transform the homogeneous space of 4D into 3D space. This is similar to setting a component in the coordinates (x, y, z) of a 3D space to 1, and then converting it to the plane space of a 2D space. Vertices can be translated, rotated, or scaled.
Vector: it is also a triplet (x, y, z), but it represents a direction. That is, from the origin to (x, y, z. It has the length and direction attributes and has no location attributes. Therefore, it can have many parallel equal values. In its homogeneous coordinates (x, y, z, W), w takes 0. In this case, when 0 is used, the coordinates can be rotated and scaled, translation transformation is not allowed. Because the vector itself has no location attribute, it is meaningless to perform a translation transformation on it.
TIPS: the general transformation matrix is a composite matrix of the Rotation Transformation Matrix (divided into three different matrices X, Y, and Z axes), the scaling matrix, and the translation matrix. To compose a transformation matrix, multiply each matrix in the desired transformation order. This composite matrix is a 4x4 matrix. To make the matrix effective during the transformation of the vertices and vectors, they must be extended to the same space.
By: loo.tam@gmail.com