If that's right, my guess is there's no advantage of that for triangles. It seems like something you'd do for a complex polygon.
EDITED: This (https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal) link has pseudo code for Newell's Method that I have heard of and used before. Doing a quick search turns up similar looking C like code. This method is kind of fuzzy I think and it's more clear that it's not intended for triangles.
EDITED: glmath.h has calculate_normal that uses the same way. At least that solves the code duplication problem.
In various places the following code is used to produce surfaces normals. Never mind it shouldn't be so duplicated.
Standard cross-product way is 6 multiplications and 9 additions. Looking around I think this is probably like Method 2 here (https://www.euclideanspace.com/maths/algebra/vectors/applications/normals/index.htm) that seems to use 3 projected areas.
If that's right, my guess is there's no advantage of that for triangles. It seems like something you'd do for a complex polygon.
EDITED: This (https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal) link has pseudo code for Newell's Method that I have heard of and used before. Doing a quick search turns up similar looking C like code. This method is kind of fuzzy I think and it's more clear that it's not intended for triangles.
EDITED: glmath.h has calculate_normal that uses the same way. At least that solves the code duplication problem.