vertices , UVs, triangles
The code in Listing 5-6 creates three separate arrays, each of a different data type. Vertices for
storing all vertices in the mesh, UVs for storing UV data for each vertex (elements in this array map
to vertices in the Vertices array), and finally the Triangles array, for the faces of the quad. It is set
to int array of six elements. This does not mean our quad will have six faces, however. Our quad
is formed from two faces—two right-angled triangles aligned together at the hypotenuse. The
Triangles array is initialized to six because our mesh has two triangles, and each triangle is made
from three vertices (3×2=6).
//layout
// 2------3
// --------
// --------
// --------
// 0-------1




浙公网安备 33010602011771号