Applying transformations
Moving, rotating, and otherwise manipulating vertex data may seem quite straight forward. One may even be tempted to simply update the vertex position information and simply resubmit that data back to the VBO. While things may have been done that way for a while in the past, there are much more efficient, albeit more math-intensive ways of performing this task. Displacing vertices is now done in the vertex shader by simply multiplying the vertex positions by something called a matrix.
Matrix basics
Matrices are extremely useful in graphics programming, because they can represent any kind of rotation, scale, or displacement manipulation that can be applied to a vector. There are many different types of matrices, but they are all just blocks of information that look similar to this:
This particular matrix is a 4x4 identity matrix, but a variety of differently sized matrices exist, such as 3x3, 2x3, 3x2, and so on. There are rules when it comes to adding, subtracting,...