Math for Game Development and WebGL Part 6: Matrix Math Intro What is a matrix? A matrix is a rectangular array of numbers arranged in rows and columns: $$\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}$$ You may think, isn’t a vector also a rectangular array of numbers? Yes, you can also think of a vector as a matrix with one row or one column (row vs column […]

Math for Game Development and WebGL Part 4: Sine, Cosine, and Tangent Now we’re going to talk about math with triangles and certain measurements and properties of triangles. Also known as, trigonometry. It’s not as scary as it sounds. We already know the Pythagorean theorem, we used it to find the magnitude (aka length) of our vector. It turns out that other properties of triangles are very […]

Math for Game Development and WebGL Part 2: Vector Multiplication In the last post we talked about what a vector was, how to add and subtract vectors, and how to find the magnitude of a vector. We also demonstrated that by adding vectors we could translate (aka, move) a square around in two dimensions. Now we’ll look at scaling vectors using multiplication. Multiply Vector by Scalar […]

Math for Game Development and WebGL Part 1: Vectors After rekindling my interest in 3D game development, I looked at WebGL. Being a web dev, this made sense. Unfortunately resources for this are mediocre at best. While WebGL2Fundamentals and the Introduction to Computer Graphics book do cover some of what’s needed, they largely skip the actual math and just tell you to do something. […]