Exhibit #11: Setting the Viewport
What We Did
- Again, the viewport is the area on the screen that is drawn upon.
- We can set the viewport with the
gl.viewport(left, bottom, width, height)
command.
- The units of the arguments are pixels.
- The values
left
and bottom
are the following coordinate system:
- $(0,0)$ is the bottom-left corner.
- $(canvas.width,canvas.height)$ is the top-right corner.
- This only affects the primitives drawn. This does not affect the clearing of the screen.