Chapter 2

Setting Up Your Graphic Projections

WHAT’S IN THIS CHAPTER?

  • Understanding how the different types of projection matrices work, how to use them, and when
  • Getting familiar with the template application that comes with the SDK and learning how to customize it for your specific needs
  • Building your first practical application — learning how to set it up and use the different types of projections

Before you can draw any graphics onscreen, you first need to create a projection matrix. The type of graphics you plan to use will have a direct impact on the creation of this matrix. Whether it is 2D, 2.5D, or 3D, each type of projection matrix will require a different initialization, allowing you to create the necessary perspective for your specific needs.

In this chapter, you will learn about the three primary types of projections used in modern mobile games and how to use them.

In addition, this chapter will teach you how to work with this book’s template project and walk you through three progressive exercises. In these exercises, you will learn how to manipulate the most common types of graphic projections and draw simple geometry onscreen; handle vertex and fragment shaders and link them to a shader program; manipulate vertex attributes and uniform variables; translate, rotate, and scale basic geometry; and create a simple camera look-at matrix.

THE THREE BASIC TYPES OF PROJECTIONS

When drawing using OpenGL ES, you always have to keep in mind the sequence of your drawings ...

Get Game and Graphics Programming for iOS and Android® with OpenGL® ES 2.0 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.