One of the big questions that we haven’t yet tackled is this: How does OpenGL
take the coordinates that we’ve given it and map those to actual physical
coordinates on the screen?
The answer to this question is complicated, and we’ll learn more about it as
we progress through the chapters. For now, all we need to know is that
OpenGL will map the screen to the range [-1, 1] for both the x and the y
coordinates. This means that the left edge of the screen will correspond to -1
on the x-axis, while the right edge of the screen will correspond to +1. The
bottom edge of the screen will correspond to -1 on the y-axis, while the top
edge of the screen will correspond to +1.
This range stays the same regardless of the shape or size of the screen, and
everything that we draw needs to fit within this range if we want it to show
up on the screen. Let’s go back to the constructor and update the coordinates
defined in tableVerticesWithTrianglesas follows: