O'Reilly logo

Beginning Android 4 Games Development by Robert Green, Mario Zechner

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

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 ...

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