# Finding outward face normals

This topic is 4127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello,all! I have a surface described by triangular mesh when I get the list of vertixes belonging to each triangle and the list of triangles. I want to find outward normals for every triangle, however, I don't know whether the order of the vertixes obeys the right hand rule. What I do succeed to do is to define a correct normal for one triangleor define a point inside or outside the surface (if it is closed) or a point at the visible side (if the surface is not closed). Is there a way to define all the normals as they should be? Thanks, mshr25

##### Share on other sites
When you know which direction that the normal for 1 triangle points and if all your triangles use shared vertices then search for a neighbouring triangle and calculate it's normal, also get the vector going between the unshared vertices of the 2 triangles. Calculate two dot products using that vector and the two normals, multiply those 2 results and if the result is positive then you have to reverse the new normal. There may be small errors which could cause problems with triangles that are on the same plane so you may need check for that or test against a small positive value rather than testing with >0.0

if your vertices aren't all shared then you'll need to search for triangles that have two vertices with matching coords.

Someone else might have an easier/simpler way but that's all I can think of at the moment.

##### Share on other sites
Just thought of another method, since you say you can find a point either inside or outside of the object then for each triangle calculate the normal and add that to the coords of one of your triangles vertices. then using the line from that coord to your known point do intersection tests on all the triangles of your object and count the number of tests that pass, you can tell if the normal is pointing the right way if the number of intersections is even or odd (depending on whether your known point is inside or outside).

EDIT:
There could be problems with this where the outside faces of 2 tris are facing toward each other, instead of adding the normal to a vertex you could maybe find a point in the triangle by averaging the 3 vertices or something and then add a small fraction of the normal.

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 12
• 16
• 9
• 14
• 10
• ### Forum Statistics

• Total Topics
632657
• Total Posts
3007680
• ### Who's Online (See full list)

There are no registered users currently online

×