Answer by Berenger
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...
View ArticleAnswer by Eric5h5
You can get the surface normal of a triangle like this: var v0 = vertices[0]; var v1 = vertices[1]; var v2 = vertices[2]; var surfaceNormal = Vector3.Cross (v1 - v0, v2 - v0).normalized; vertices[0],...
View ArticleAnswer by Berenger
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...
View ArticleAnswer by Eric5h5
You can get the surface normal of a triangle like this: var v0 = vertices[0]; var v1 = vertices[1]; var v2 = vertices[2]; var surfaceNormal = Vector3.Cross (v1 - v0, v2 - v0).normalized; vertices[0],...
View Article