Simple Cameras

In the previous chapter, we talked about two ways to create a camera. The first one, the Euler camera, was similar to what is used in first-person shooters. The second one, the look-at camera, is used for cinematic camera work or for following an object. Let's create two helper classes that we can use in our games.

The First-Person or Euler Camera

The first-person or Euler camera is defined by the following attributes:

  • The field of view in degrees.
  • The viewport aspect ratio.
  • The near and far clipping planes.
  • A position in 3D space.
  • An angle around the y-axis (yaw).
  • An angle around the x-axis (pitch). This is limited to the range −90 to +90 degrees. Think how far you can tilt your own head and try to go beyond those angles! We ...

Get Beginning Android 4 Games Development 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.