Chapter 9. Introducing WebGL

In this chapter, we will cover:

  • Creating a WebGL wrapper to simplify the WebGL API
  • Creating a triangular plane
  • Rotating a triangular plane in 3D space
  • Creating a rotating cube
  • Adding textures and lighting
  • Creating a 3D world that you can explore

Introduction

Originally, when I first started writing this book, I had intended on only covering the 2D context of the HTML5 canvas (I strongly believe that most people who use canvas will be working with this context). I had also originally intended on covering techniques for rendering 3D shapes in the 2D context using 3D projection methods and vector operations. People were already busy creating some pretty incredible 3D JavaScript libraries for the 2D context, including Kevin Roast's ...

Get HTML5 Canvas Cookbook 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.