# Computer Graphics Review

## Matricies§

- Matrices are useful in computer graphics, as they allow us to define transformations within a space.
- In graphics, 3D objects are often represented by a mesh – a collection of vertices and their connectivity.
- We assume that connectivity is unchanged under transformation.

Transformation

Let $T \in \mathbb{R}^{4 \times 4}, p \in \mathbb{R}^{4 \times 1}, p’ \in \mathbb{R}^{4 \times 1}$. Then, a transformation may be expressed via

$$ Tp = p’, $$

where $T$ is our transformation matrix, $p$ and $p’$ are our 3D position in homogeneous coordinates before and after transformation by $T$, respectively.

In the case of a composition of transformations, i.e. let $A_1, A_2, \dots, A_{n - 1}, A_n \in \mathbb{R}^{4x4}$ be transformations, then

$$ p’ = A_n A_{n-1} \dots A_2 A_1 p $$

is composed from right to left, i.e.

$$ p’ = A_n(A_{n-1}(\dots (A_2(A_1(p))))) $$

## Matrix Stack§

- The first element is the identity.
- All matrix operations are right multiplied