HTML and CSS Reference
What Does a WebGL Application Look Like?
Now we are going to show you a WebGL application demo that rotates a 3D cube on Canvas
describing every line of code in the example; instead, we will highlight interesting sections of
code to help you understand what is happening.
ThisdemoisbasedonLesson4from Giles Thomas'sLearning WebGLwebsite .While thisis
only one short demo, it should give you a very good idea of how to structure and build code
for a WebGL application.
Much of this code has been adapted from the work of Giles Thomas with his express written permis-
Figure 11-2. 3D rotating cube (CH11EX1.html)
browser. This version was freshly released, but it could be updated with new features at any