Package: graphene

Function graphene:triangle-uv

Lambda List

graphene:triangle-uv (triangle point a b c result)

Arguments

triangle -- a graphene:triangle-t instance
point -- a graphene:point3d-t instance
a -- a graphene:vec2-t instance with the UV coordinates of the first point
b -- a graphene:vec2-t instance with the UV coordinates of the second point
c -- a graphene:vec2-t instance with the UV coordinates of the third point
result -- a graphene:vec2-t instance containing the UV coordinates of the given point

Return Value

The graphene:vec2-t instance with the UV coordinates of the given point, of nil if the result is not valid.

Details

Computes the UV 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 point is nil, the point will be set to (0, 0, 0).

The UV coordinates will be placed in the result vector:
result.x = u
result.y = v  
See also the graphene:triangle-barycoords function.
 

See also

#2023-12-7