From B Stack – GAMES101- Introduction to Modern Computer Graphics – Lingqi Yan

Front knowledge

Judging the direction = “right hand spiral rule, A cross b, four-finger direction is a-> B, thumb direction is a cross B direction.

Judge inside and out?AB cross AP is going out, p is to the left of AB, BC cross BP is going out, P is to the left of BC, CA cross cp is going out, P is to the left of CA so P is inside the triangle

1 2D linear transformation

We define the simple matrix multiplication shown below as a linear transformation of the vector (x, y) ^T^.

1.1 zoom (scaling)

1.2 reflection

1.3 cut (shearing)

Shear transformation is intuitively understood to be to fix one side of an object and then pull the other side, as defined below:

1.4 rotation (rotation)

Derivation process:

1.5 translation

Apply the linear change, then shiftBecause you can’t express it as a linear change, but they wanted to be convenient, so they introduced homogeneous coordinates.I’m going to shift it by adding 1. In homogeneous coordinatesAll changes can be written in uniform form using homogeneous coordinates, at the cost of introducing an extra number

1.6 inverse transformation

1.7 Changes in Composition