OpenGL matrices
For matrix operations to work together nicely, use this convention:
(x, y, z, 1)
is a position in space.(x, y, z, 0)
is a vector.
Translation matrix
$$\begin{bmatrix}
1 & 0 & 0 & X\
0 & 1 & 0 & Y\
0 & 0 & 1 & Z\
0 & 0 & 0 & 1\
\end{bmatrix}$$
Scaling matrix
$$\begin{bmatrix}
x & 0 & 0 & 0\
0 & y & 0 & 0\
0 & 0 & z & 0\
0 & 0 & 0 & 1\
\end{bmatrix}$$
|
|
# The Final Product
|
|
|
|