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 5. Camera and User Interaction

It is impossible to imagine a 3D game without a camera. WebGL does not provide a camera class. We have learned that WebGL is a low-level API, but it gives us a rendering API to help us write one of our own implementations. This chapter is focused on evolving our own camera class for our game scene. We will also empower our users to view the game scene from different angles and positions by adding mouse and keyboard interactivity. We will also implement different types of cameras used in gaming. The topics we will cover are as follows:

  • ModelView transformations
  • Perspective transformations
  • The basic camera
  • The free camera
  • Controlling the camera with the keyboard and mouse
  • The orbit camera

Understanding ModelView transformations ...

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