3D mathematics-matrix and linear transformation (4)

Source: Internet
Author: User

Conversion combination

Imagine an object in any direction and position in the world. We want to render it to a camera in any direction and position. To achieve this, all vertices of an object must be transformed from the object coordinate system to the world coordinate system, and then from the world coordinate system to the camera coordinate system. The mathematical transformations are summarized as follows:

Matrix Multiplication satisfies the combination law, so we can use a matrix to directly transform from the object coordinate system to the camera coordinate system:

In this way, all matrices can be combined out of the rendering loop, so that the matrix multiplication in the loop only needs to be multiplied by a matrix (the object has many vertices, saving a single matrix multiplication method will increase a lot of efficiency), as shown below:

Therefore, matrix combination uses the combination law of matrix multiplication from the perspective of algebra. The row vector of the matrix is the base vector after transformation, which is also true in the case of multiple transformations. Matrix MultiplicationAB, Each row in the result isACorresponding rows and matrices inBThe result of multiplication. In other words, set A1, A2, and A3ACan be written as follows:

This makes the conclusion clearer,ABThe row vector in the result is indeedABase vectorBThe result of the transformation.

 

Change category

The transformed category is not mutually exclusive, and there is no certain "order" or "hierarchy", which makes one category more or less restrictive than the other category.

When we discuss general transformations, we will use a similar term: ing or function. In the most general sense, ing is a simple rule that accepts input and generates output. WeAToBOfFIngF(A) =B.

 

Linear transformation

In mathematics, if the following formula is met, the ingF(A) Is linear:

F(A+B) =F(A) +F(B) AndF(KA) = KF(A)

If the ing F maintains the basic operation: Addition and multiplication, The ing can be called linear. In this case, the result of adding the two vectors and then performing the transformation is the same as that of adding the transformed vectors. Similarly, the result of the number multiplication transformation of a vector is the same as that of the first line transformation and then number multiplication.

The definition of this linear transformation has two important lements:

(1) ingF(A) =AM, WhenMFor any square matrix, the ing is a linear transformation because:

F(A+B) = (A+B)M=AM+BM=F(A) +F(B)

And

F(KA) = (KA)M= K (AM) = KF(A)

(2) The result of any linear transformation of zero vectors is still zero vectors. (IfF(0) =A,A=0. SoFIt cannot be a linear transformation. BecauseF(K0) =A,F(K0) ≠ KF(0), So linear transformation will not cause translation (the origin position will not change ).

In some documents, linear transformation is defined as a parallel line after transformation. In most cases, it is right, but there is a small exception: projection (when a linear projection becomes a point, what can we think of this point as parallel ?) In addition to this theoretical exception, this definition is correct. Linear transformation may cause "stretching", but the straight line does not "Bend", so the parallel lines are still parallel.

 

Affine Transformation

Affine Transformation refers to linear transformation followed by translation. Therefore, the set of affine transformations is the superset of linear transformation. Any linear transformation is an affine transformation, but not all of them are linear transformation.

Any FormV'=VM+BAll transformations are affine transformations.

 

REVERSIBLE TRANSFORMATION

If there is a inverse transformation that can "undo" the original transformation, the transformation is reversible. In other words, if there is a inverse transformationG, MakingG(F(A) =AFor anyA, IngF(A) Is reversible.

There is a reversible transformation of non-affine transformations, but they are not considered for the moment. Now, we focus on checking whether an affine transform is reversible. An affine transformation is a linear transformation plus translation. Obviously, the opposite amount can be used to "undo" the translation part, so the question is whether a linear transformation is reversible.

Obviously, all transformations except projection can be "undo". When an object is projected, some useful information in one dimension is discarded, which cannot be recovered. Therefore, all basic transformations except projection are reversible.

Any linear transformation can be expressed as a matrix, so the inverse transformation is equivalent to the inverse of the matrix. If the matrix is singular, the transformation is irreversible. The determinant of the reversible matrix is not 0.

 

Equisigned Transformation

If the angle and direction of the two vectors before and after the transformation do not change, the transformation is of the same angle. Only translation, rotation, and even scaling are equal-angle transformations. The proportional transformation will remain unchanged. The image is not an equisigned transformation, because although the angle between the two vectors remains unchanged, the angle direction changes. All angular transformations are affine and reversible.

 

Orthogonal Transformation

The term "orthogonal" is used to describe a matrix of a certain nature. The basic idea of orthogonal transformation is that the axes are perpendicular to each other without scaling.

Translation, rotation, and mirroring are only orthogonal transformations. The length, angle, area, and volume remain unchanged. (Even so, image transformation is considered orthogonal transformation, so you must pay close attention to the accurate definition of angle, area and volume ).

The determinant of the orthogonal matrix is 1 or negative 1. All orthogonal matrices are affinable and reversible.

 

Rigid Body Transformation

A rigid body transformation only changes the position and direction of an object, excluding the shape. The length, angle, area, and volume remain unchanged. Translation and rotation are only rigid-body transformations, and images are not considered rigid-body transformations. Rigid Body transformations are also called regular transformations. All rigid body transformations are orthogonal, angular, reversible, and affinable. Some Rigid Body transformations have a rotation matrix of 1.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.