Working with a Virtual Coordinate Space

To adjust the coordinate space so that we can take screen orientation into account, we need to stop working directly in normalized device coordinates and start working in a virtual coordinate space. We then need to find some way of converting coordinates from our virtual space back into normalized device coordinates so that OpenGL can render them correctly. This conversion should take the screen orientation into account so that our air hockey table will look correct in both portrait and landscape modes.

What we want to do is called an orthographic projection. With an orthographic projection, everything always appears the same size, no matter how close or far away it is. To better understand what this type ...

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.