I want to understand logic behind drawing triangles of primitives in Unity. When we spawn simple cube, variable mesh.vertexCount gives us value 24. Also when we list all vertices positions (from mesh.vertices) and triangles numbers (from mesh.triangles), we get:
0. (1.0, -1.0, 1.0) 0
1. (-1.0, -1.0, 1.0) 2
2. (1.0, 1.0, 1.0) 3
3. (-1.0, 1.0, 1.0) 0
4. (1.0, 1.0, -1.0) 3
5. (-1.0, 1.0, -1.0) 1
6. (1.0, -1.0, -1.0) 8
7. (-1.0, -1.0, -1.0) 4
8. (1.0, 1.0, 1.0) 5
9. (-1.0, 1.0, 1.0) 8
10. (1.0, 1.0, -1.0) 5
11. (-1.0, 1.0, -1.0) 9
12. (1.0, -1.0, -1.0) 10
13. (1.0, -1.0, 1.0) 6
14. (-1.0, -1.0, 1.0) 7
15. (-1.0, -1.0, -1.0) 10
16. (-1.0, -1.0, 1.0) 7
17. (-1.0, 1.0, 1.0) 11
18. (-1.0, 1.0, -1.0) 12
19. (-1.0, -1.0, -1.0) 13
20. (1.0, -1.0, -1.0) 14
21. (1.0, 1.0, -1.0) 12
22. (1.0, 1.0, 1.0) 14
23. (1.0, -1.0, 1.0) 15
(i-th element, vector from mesh.vertices[i], number from mesh.triangles[i])
Obviously we need only 8 vertices to create cube, but we need 6*2=12 triangles, three vertices every - array of 36 vectors. So... what is the logic of Unity primitive?