December 2011
Beginner
693 pages
19h 56m
English
You already learned that OpenGL ES needs a couple of things set before we can tell it to draw some geometry. The two things about which we are most concerned are the projection matrix (and with it our view frustum) and the viewport, which governs the size of our output image and the position of our rendering output in the framebuffer.
OpenGL ES uses the viewport as a way to translate the coordinates of points projected to the near clipping plane to framebuffer pixel coordinates. We can tell OpenGL ES to use only a portion of our framebuffer—or all of it—with the following method:
GL10.glViewport(int x, int y, int width, int height)
The x- and y-coordinates specify the top-left corner of ...
Read now
Unlock full access