In Chapter 7, you learned that a vertex has a few attributes:
Vertices, which handles all the dirty details for you. You limited the vertex positions to have only x- and y-coordinates. All you need to do to go 3D is modify the
Verticesclass so that it supports 3D vertex positions.
Let's write a new class called
Vertices3 to handle 3D vertices based on your original
Vertices class. Listing 10–1 shows the code.
package com.badlogic.androidgames.framework.gl; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; import java.nio.ShortBuffer; ...