O'Reilly logo

WebGL Beginner's Guide by Brandon Jones, Diego Cantor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Architectural updates

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.

WebGLApp review

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.

Adding support for matrix stacks

The diagram also shows a new script: SceneTransforms.js. This file contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required