O'Reilly logo

WebGL Game Development by Sumeet Arora

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

Chapter 3. Loading the Game Scene

In the previous chapter, we learned how to load objects exported from Blender and learned about directional lights. We learned many WebGL API calls and now in this chapter, we will put our knowledge to good use. In this chapter, we will not discuss any new WebGL call but we will use our knowledge to create a small game scene. But, before we do that, we will need to perform some code updates.

The code we developed in Chapter 2, Colors and Shading Languages, is not capable of handling multiple objects, and so, we will structure that code first.

The following are the topics that we will cover in this chapter:

  • Code changes to support multiple objects
  • WebGL, a state machine
  • Request animation frames
  • Load the scene
  • Positional ...

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