December 2011
Beginner
693 pages
19h 56m
English
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 Vertices class 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.
Listing 10–1. Vertices3.java, Now with More Coordinates.
package com.badlogic.androidgames.framework.gl;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.nio.ShortBuffer; ...Read now
Unlock full access