O'Reilly logo

Learning Three.js: The JavaScript 3D Library for WebGL by Jos Dirksen

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

Working with the camera

Three.js has a number of camera controls that you can use to control the camera throughout a scene. These controls are located in the Three.js distribution and can be found in the examples/js/controls directory. In this section we'll look at the following controls:

Name

Description

FirstPersonControls

Controls that behave like those in first person shooters. Move around with the keyboard, and look around with the mouse.

FlyControls

Flight simulator like controls. Move and steer with the keyboard and the mouse.

RollControls

A simpler version of the FlyControls. Allows you to move around and roll around the z-axis.

TrackBallControls

Most used controls, allow you to use the mouse (or the trackball) to easily ...

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