HTML and CSS Reference
Listing 9.28. run.js—Cube shape
Step 2: Add color, rotation, and index data for cubes
You now need to append the gd.template.Cube.init() method with color, rota-
tion, and indices data from the next listing. If you're wondering what indices are, they al-
low you to draw the sides of a square with four points. Normally, a square's side requires
six points to create two triangles—this cuts down on code and makes it easier to maintain.