3D game development basics

Concept learning:

vector

Vector Profile

We all parallel to each other in translation vector, so that the starting point coincides with the coordinate origin, when the starting end coincides with the coordinate origin of a vector, we are in the standard position into the vector. Thus, we can use the vector coordinates of the end point of a vector is described in the standard position. We usually lowercase bold letters a vector, is also uppercase bold letters, such as: 2D, 3D, 4D vector are represented as: u = (u_ {x}, u_ {y}), N = (N_ {x}, N_ {y}, N_ {z}), c = (c_ {x}, c_ {y}, c_ {z}, c_ {w}). D3DX library class D3DXVECTOR3 vector representing 3D space.

Vector equal

Geometry, if the two vectors have the same length and direction, then these two vectors are equal.

Vector length

||u||= sqrt(u_x^2+u_y^2+u_z^2)

Vector standardization

Vector normalization is to make changes to a magnitude of a vector, i.e., becomes a unit vector. Normalized vectors may be accomplished by dividing each component of the vector are divided by the modulus of the vector.

Vector addition

Is defined as the vector addition of two vectors each corresponding component addition, only two components of the same dimensions can be addition.
u + v = (u_x + v_x , u_y + v_y, u_z + v_z)

Vector subtraction

u-v = u+(-v) = (u_x-v_x, u_y-v_y, u_z-v_z)

Multiplication

Scalar and vector may be multiplied, as the name implies, this operation may be scaled to vector.
ku = (ku_x, ku_y, ku_z )

Dot product

Is one of two dot product multiplication vector algebra defined, the calculation rule is as follows:
U * = V * v_x u_x v_y + + u_y * * v_z u_z
above formula does not have a significant geometrical meaning, by the law of cosines can be found u * v = || u || * || v || * cosθ, i.e. dot product of two vectors is equal to two and then multiplied by the cosine of the angle between two vectors of the mold.

Cross product

a\*b = x_1\*y_2-x_2\*y_1 = x_1 \* y_2 - x_2 \* y_1 = a \* b \* sinθ

matrix

Matrix equal

Matrix multiplication

Matrix addition

Matrix Multiplication

If A is an m * n matrix, B is n * p matrix, then the product AB meaningful, and is equal to an m * p matrix

Matrix

Inverse matrix

Matrix transpose

A m * n matrix is ​​the transpose of a matrix of n * m. We use the symbol M ^ T represents a transposed matrix of M

Guess you like

Origin www.cnblogs.com/acmlzq/p/11279780.html