Chapter 3. Working with the Camera

In this chapter, we'll cover the following recipes:

  • Making the camera follow an object
  • Zooming the camera to an object
  • Using a perspective camera
  • Using an orthographic camera
  • Creating a 2D overlay
  • Rotating the camera around a scene
  • Matching the rendered view to a resized browser
  • Converting world coordinates to screen coordinates
  • Selecting an object in the scene

Introduction

One of the most important objects in Three.js is the camera. With the camera, you define what part of the scene will be rendered and how the information will be projected on the screen. In this chapter, we'll show you a number of recipes that will allow you to add more complex camera functionality to your Three.js applications.

Get Three.js Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.