We completed the previous chapter with a red rectangle painted into the window of a Web browser. The process to make the rectangle included the following steps: setting up data inside a vertex and fragment shader; storing the information in buffers; and commanding the WebGL application to execute its drawing instructions. If these steps make up the state and behavior of a WebGL program that rasterizes 2D content, and every WebGL program is a machine that operates on state, then how can we use what we have already created to add a third dimension to our scene?
The following ...