for(int i = 0, n = 0; i < mesh.triangles; i += 3, n++){
Vector3 normal = mesh.normal[n];
Vector3 p1 = mesh.vertices[ mesh.triangles[i] ];
Vector3 p2 = mesh.vertices[ mesh.triangles[i+1] ];
Vector3 p3 = mesh.vertices[ mesh.triangles[i+2] ];
// Do your business here
}
That code isn't tested.
↧