Summary

In this chapter, we have looked at the four basic elements that are always present in any WebGL application: canvas, objects, lights, and camera.

We have learned how to add an HTML5 canvas to our web page and how to set its ID, width, and height. After that, we have included the code to create a WebGL context. We have seen that WebGL works as a state machine and as such, we can query any of its variables using the getParameter function.

In the next chapter we will learn how to define, load, and render 3D objects into a WebGL scene.

Get WebGL Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.