Defining an Orthographic Projection
To define an orthographic projection, we’ll use Android’s Matrix class, which resides in the android.opengl package. In that class there’s a method called orthoM, which will generate an orthographic projection for us. We’ll use that projection to adjust the coordinate space, as we just discussed in Adjusting to the Aspect Ratio, and as we’ll soon see, an orthographic projection is very similar to a translation matrix.
Let’s take a look at all of the parameters for orthoM:
orthoM(float[] m, int mOffset, float left, float right, float bottom, float top, float near, float far)
float[] m |
The destination array—this array’s length should be at least sixteen elements so it can store the orthographic projection ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access