I've done Raycast in a normal of my cube.
I get the normal with:
RaycastHit.normal
My Question: How I can find the vectors of the vertices of the normal??
Thanks!
I've done Raycast in a normal of my cube.
I get the normal with:
RaycastHit.normal
My Question: How I can find the vectors of the vertices of the normal??
Thanks!
I think the terminology is a little confused here. I think you're saying "normal" when you mean "triangle".
http://en.wikipedia.org/wiki/Surface_normal
This is how you get the corner vertexes of the triangle.
http://unity3d.com/support/documentation/ScriptReference/RaycastHit-triangleIndex.html
You could use RaycastHit.triangleIndex.
This function works only if the collider that was hit is a MeshCollider.
try barycentric coordinates. the example on the link below does exactly what you are looking for-- an interpolated normal based on the triangle you hit.
http://unity3d.com/support/documentation/ScriptReference/RaycastHit-barycentricCoordinate.html