Let's review the structure of the examples developed in the book. Each web page includes several scripts. One of them is
WebGLApp.js. This script contains the
WebGLApp object defines three function hooks that control the life cycle of the application. As shown in the diagram, we create a
WebGLApp instance inside the
runWebGLApp function. Then, we connect the
WebGLApp hooks to the
configure, load, and
draw functions that we coded. Also, please notice that the
runWebGLApp function is the entry point for the application and it is automatically invoked using the
onload event of the web page.
The diagram also shows a new script:
SceneTransforms.js. This file contains ...