Defining the Structure of Our Air Hockey Table

Before we can draw our table to the screen, we need to tell OpenGL what to draw. The first step in that chain is to define the structure of our table in a form that OpenGL understands. In OpenGL, the structure of everything begins with a vertex.

Introducing Vertices

A vertex is simply a point representing one corner of a geometric object, with various attributes associated with that point. The most important attribute is the position, which represents where this vertex is located in space.

Building Our Table with Vertices

We said we would keep things easy for now, so what’s the most basic shape we could use to represent the structure of our air hockey table? We could use a rectangle. Since a rectangle ...

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.