Linear Algebra 101

So much of OpenGL works with vectors and matrices, and one of the most important uses of a matrix is in setting up orthographic and perspective projections. One of the reasons for this is that at the heart of things, using a matrix to do a projection just involves a bunch of “adds” and “multiplies” over a set of data in sequence, and modern GPUs are very, very fast at that sort of thing.

Let’s go back in time to when you were in high school or college and review the basics of linear algebra. If you don’t remember, have bad memories, or never took the class, there’s no need to worry; we’ll walk through the basic math together. Once we understand the basic math, we’ll then learn how we can use a matrix to do an orthographic ...

Get OpenGL ES 2 for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.