O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Adding a Geometry Class

We now have a good idea of what we need to build a puck and a mallet: for the puck, we need one triangle fan for the top and one triangle strip for the side; for the mallet, we need two triangle fans and two triangle strips. To make it easier to build these objects, we’ll define a Geometry class to hold some basic shape definitions and an ObjectBuilder to do the actual building.

Joe asks:
Joe asks:
Why Not Just Use a Library?

There are decent 3D libraries for Android out there, ranging from libgdx,[36] a thin open-source wrapper, to more advanced commercial frameworks such as Unity3D.[37] These libraries can help improve your productivity, ...

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