Documentation / @ripl/3d / vec3TriangleNormal
Function: vec3TriangleNormal() ​
vec3TriangleNormal(
a,b,c):Vector3
Defined in: 3d/src/math/vector.ts:65
Returns the unit-length normal of the triangle a → b → c, wound counter-clockwise.
A degenerate triangle — zero area, so no defined facing — yields the up vector rather than vec3Normalize's zero vector, so a collapsed face still shades instead of going black.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
a | Vector3 | The triangle's first vertex. |
b | Vector3 | The triangle's second vertex. |
c | Vector3 | The triangle's third vertex. |
Returns ​
The triangle's unit normal.