Extra indices for createCube()

Forum for the book "Beginning Android Games", see http://www.apress.com/9781430230427

Extra indices for createCube()

Postby Bird » Fri Dec 23, 2016 8:13 am

I have the 2nd Edition. On page 551:
-0.5f, -0.5f, -0.5f, 0, 1, 0, -1, 0,
0.5f, -0.5f, -0.5f, 1, 1, 0, -1, 0,
0.5f, -0.5f, 0.5f, 1, 0, 0, -1, 0,
-0.5f, -0.5f, 0.5f, 0, 0, 0, -1, 0 };
short[] indices = { 0, 1, 2, 2, 3, 0,
4, 5, 6, 6, 7, 4,
8, 9, 10, 10, 11, 8,
12, 13, 14, 14, 15, 12,
16, 17, 18, 18, 19, 16,
20, 21, 22, 22, 23, 20,
24, 25, 26, 26, 27, 24 };
Vertices3 cube = new Vertices3(glGraphics, vertices.length / 8, indices.length,
false, true, true);
cube.setVertices(vertices, 0, vertices.length);
cube.setIndices(indices, 0, indices.length);
return cube;
}
The createCube() method is mostly the same as the one we used in previous examples.
This time, however, we add normals to each vertex as shown in Figure 11–4. Apart from
that nothing really changed.

What are the extra Indices, "24, 25, 26, 26, 27, 24" for?

Thanks
Bird
 
Posts: 18
Joined: Mon Jun 16, 2014 1:54 am

Return to Beginning Android Games

Who is online

Users browsing this forum: No registered users and 1 guest