Quantcast
Channel: Answers for "Direction of a mesh"
Browsing all 4 articles
Browse latest View live

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 Article


Answer 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


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 Article

Answer 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
Browsing all 4 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>