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

Understanding the free camera

The FreeCamera class that we are going to write will be controlled by the keyboard. We would like to move forward, backward, left, right, and rotate on its axes. Let's first define the actions that we want our free camera to perform with the corresponding key combinations. The key combinations and the respective actions to be performed are shown in the following table:

Key combination

Action to be performed

Left arrow

Move to the left along the x axis

Right arrow

Move to the right along the x axis

S

Move to the left along the y axis

W

Move to the right along the y axis

Up arrow

Move to the left along the z axis

Down arrow

Move to the right along the z axis

Shift + A

Tilt to the left

Shift

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