Package: graphene
Function graphene:triangle-barycoords
Lambda Listgraphene:triangle-barycoords (triangle point result) ArgumentsReturn ValueThe graphene:vec2-t instance with the barycentric coordinates, or nil if the result is not valid Details
Computes the barycentric coordinates of the given point.
The point must lie on the same plane as the triangle. If the point is not
coplanar, the result of this function is undefined. If we place the origin in the coordinates of the triangle's A point, the barycentric coordinates are u, which is on the AC vector, and v which is on the AB vector. The returned vector contains the following values, in order: result.x = u result.y = v | See also |
#2023-12-8