Obtaining consistent triangle surface normals.

42 Views Asked by At

I am given 3 points in a random order like so...

calculateSurfaceNormal(point1, point2, point3);

I have implemented the method by simply saying...

cross(subtract(point2, point1), subtract(point3, point1));

This calculates the normal to point 1.

The problem is, if I swap point2 and point3 as arguments into the method, my implementation will give me a normal in the opposite direction to the first one.

So the question is, is it possible to modify my implementation so as I always get normals in one direction. And I choose that one direction to be away from the origin rather than towards the origin.

1

There are 1 best solutions below

0
On

Instead of $AB\times AC$, consider $\det(OM,AB,AC).AB\times AC$.