1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| GLfloat sommets[] = {
1.000000, -1.000000, -1.000000,
1.000000, -1.000000, 1.000000,
-1.000000, -1.000000, 1.000000,
-1.000000, -1.000000, -1.000000,
1.000000, 1.000000, -0.999999,
0.999999, 1.000000, 1.000001,
-1.000000, 1.000000, 1.000000,
-1.000000, 1.000000, -1.000000
};
GLuint indices[] = {
1, 2, 4,
5, 8, 6,
1, 5, 2,
2, 6, 3,
3, 7, 4,
5, 1, 8,
2, 3, 4,
8, 7, 6,
5, 6, 2,
6, 7, 3,
7, 8, 4,
1, 4, 8
};
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, sommets);
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, indices);
glDisableClientState(GL_VERTEX_ARRAY); |