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

Rendering

Let's take a step back to take a look at the big picture. We mentioned before that in our architecture we have defined three main functions that define the lifecycle of our WebGL application. These functions are: configure, load, and render.

Up to this point, we have set up the scene writing the code for the configure function. After that, we have created our JSON cars and loaded them by writing the code for the load function. Now, we will implement the code for the third function: the render function.

The code is pretty standard and almost identical to the draw/render functions that we have written in previous chapters. As we can see in the following diagram, we set and clear the area that we are going to draw on, then we check on the ...

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