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

Creating a New Class Structure for Our Vertex Data

We’ll start off by separating our vertex data into separate classes, with one class to represent each type of physical object. We’ll create one class for our table and another for our mallet. We won’t need one for the line, since there’s already a line on our texture.

We’ll also create a separate class to encapsulate the actual vertex array and to reduce code duplication. Our class structure will look as follows:

images/Textures/ObjectHierarchy.png

We’ll create Mallet to manage the mallet data and Table to manage the table data; and each class will have an instance of VertexArray, which will encapsulate the FloatBuffer storing ...

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