Book Image

Learning Three.js - the JavaScript 3D Library for WebGL

By : Jos Dirksen
Book Image

Learning Three.js - the JavaScript 3D Library for WebGL

By: Jos Dirksen

Overview of this book

Table of Contents (20 chapters)
Learning Three.js – the JavaScript 3D Library for WebGL Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
8
Creating and Loading Advanced Meshes and Geometries
Index

Working with the camera


Three.js has a number of camera controls 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 in more detail at the following controls:

Name

Description

FirstPersonControls

These are controls that behave like those in first-person shooters. Move around with the keyboard and look around with the mouse.

FlyControls

These are flight simulator-like controls. Move and steer with the keyboard and the mouse.

RollControls

This is a simpler version of FlyControls. Allows you to move around and roll around the z axis.

TrackBallControls

These are the most used controls, allowing you to use the mouse (or the trackball) to easily move, pan, and zoom around the scene.

OrbitControls

This simulates a satellite in orbit around a specific scene. This allows you to move around with the mouse and keyboard.

These controls are...