Skip to content

raylib.Vector3Barycenter

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) NOTE: Assumes P is on the plane of the triangle

Parameters

Parameter Default Value Note
p [0, 0, 0]
a [0, 0, 0]
b [0, 0, 0]
c [0, 0, 0]

Return value

Condition Return Value
(always) list

Notes

Example

// Point at the centroid of the triangle
a = [0, 0, 0]
b = [3, 0, 0]
c = [0, 3, 0]
p = [1, 1, 0]
bary = raylib.Vector3Barycenter(p, a, b, c)
print bary  // barycentric coordinates of p in triangle abc

Clone this wiki locally