June 2013
Intermediate to advanced
346 pages
8h 42m
English
We’re now pretty familiar with the fact that everything we render in OpenGL gets mapped to a range of [-1, 1] on both the x- and y-axes; this is also true of the z-axis. Coordinates in this range are known as normalized device coordinates and are independent of the actual size or shape of the screen. Unfortunately, because they are independent of the actual screen dimensions, we can run into problems if we use them directly, such as a squashed table in landscape mode.
Let’s say that our actual device resolution is 1280 x 720 in pixels, which is a common resolution on new Android devices. Let’s also pretend for a moment that we’re using the whole display for OpenGL, as it will make this discussion easier.
If our ...
Read now
Unlock full access