Chapter 2Defining Vertices and Shaders

This chapter introduces our first project: a simple game of air hockey. As we work on this project, we’ll learn about some of the major building blocks of OpenGL along the way.

We’re going to start off by learning how to build objects by using a set of independent points known as vertices, and then we’re going to learn how to draw these objects by using shaders, small programs that tell OpenGL how to draw an object. These two concepts are extremely important because just about every object is built by joining together vertices into points, lines, and triangles, and these primitives all get drawn by using shaders.

We’ll first learn about vertices so that we can build up our air hockey table and position ...

Get OpenGL ES 2 for Android 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.