[Math] Polarity of the Surface Normal of a 3D triangle

3dcomputational geometrygeometry

I have a triangle (defined in 3D space) that has 3 points (p1, p2 and p3).

Is it possible to work out what the polarity of the surface normal would be for the face knowing it lists each point in an anti-clockwise direction going around the face on the same side that the surface normal should point?

Edit: "Polarity" might be a bad choice of word. By polarity I mean choice between $\vec{n} $ and $-\vec{n}$ where $\vec{n}$ is the surface normal.

Edit: Surely, the surface normal orientation can be calculated if you know the order of the coordinates?

Edit: OK, I have been thinking about what exactly I am asking… cause its not clear, I know.

So….
1) I have a surface normal $\vec{n}.$
2) I use the right hand rule to determine orientation… points (p1, p2, p3) go anti-clockwise around the triangle.

Q: Given 3 points of a triangle…and after calculating its normal. How can I tell which orientation I should use, please? It's giving me a real headache!

Best Answer

You seem to be a little confused. If you know the direction of the normal, then you can determine what the order of the vertices should be. If you know the ordering of the vertices, then you can determine the direction of the normal. But if you know neither, you cannot determine either. And if you know both, what's the question?

The easy way to keep track of everything is this. When at first you are defining the triangles for your (triangulated) cube, you know which direction each face's normal should point in, so you should order the vertices of your triangles accordingly. Later, when you just have a bunch of triangles and have forgotten that they came from a cube, you can recover the direction of the normal because you know the vertices are in a consistent orientation. That's all there is to it. Leave a comment if anything's unclear.


If you have a set of vertices $\{p, q, r\}$ and you want the normal to be in the direction of some known vector $n$, then you can start by assuming the order is $(p,q,r)$, computing the corresponding normal $\tilde n = (q-p)\times(r-p)$, and checking whether the dot product $\tilde n\cdot n$ is positive; if not, take the opposite order $(r,q,p)$ instead.