Using a perspective camera
Three.js provides two cameras: a camera that renders the scene with a perspective projection (as we see images in the real world) and a camera that renders the scene with an orthogonal projection (fake 3D often used in games; for more information on this type of camera, check out the upcoming Using an orthographic camera recipe). In this recipe, we'll look at the first of these two cameras and explain how you can use the perspective camera in your own scene.
Getting ready
Working with the properties of a camera can be a bit confusing at times. To help you better understand the steps or this recipe, we've created a simple page that shows you the effect each of the camera properties has. Open up 03.03-use-an-perspective-camera.html
in the browser, and you'll see something like this:
With the last four properties available in the menu in the top-right section, you can set the properties of THREE.PerspectiveCamera
, which is used to render this scene, and...