- Home /
Draw Normal from Barycentric Coordinate (?)
Is it possible to draw a surface normal from a barycentric coordinate on RaycastHit? I've seen debug shaders that draw surface normals, but I'd like to fire a raycast on a polygon mesh and have a visualization of the normal for the point hit. Any code is welcome, C# or Java, and much appreciated. Thanks.
Answer by Graham-Dunnett · Jun 23, 2015 at 12:37 PM
The example on the documentation page computes the normal on the hit point. It even draws it. Does it not work for you?
Yes, the code sample works perfectly, however, I am trying to 'plant' the ray to the surface normal. In this way, individual rays can be placed to the surface on mouse click and visualized later, as necessary. (this functionality is very similar to posts asking how to place gameobjects to a surface using raycast hit).
$$anonymous$$aybe store the raycast hit barycenter coordinates in a temp variable and draw them, or is there a simpler way?
Your answer
Follow this Question
Related Questions
Raycast on Mesh collider 0 Answers
How to do legdegrabbing 1 Answer
How do I return local normals? 1 Answer
Raycast is always returning 1 (for normals) 1 Answer
How can I get back a hit? 1 Answer