BarycentricInterpolate
Interpolates between three vertices using barycentric weights, writing into result a vertex at an arbitrary point inside (or outside) the triangle they form.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
BarycentricInterpolate(Vertex, Vertex, Vertex, float, float, float, Vertex)
Interpolates between three vertices using barycentric weights, writing into a vertex at an arbitrary point inside (or outside) the triangle they form.
resultpublic static void BarycentricInterpolate(in Vertex a, in Vertex b, in Vertex c, float u, float v, float w, out Vertex result)
Parameters
Remarks
Use this to place a vertex anywhere within a triangle — for example when re-meshing or clipping a fill. As with Vertex.Lerp, the continuous vertex data is blended and the discrete identifying data is taken from , so the three vertices must belong to the same fill. The weights are expected to sum to 1 for a point inside the triangle, but are not validated.
aBarycentricInterpolate(Vertex, Vertex, Vertex, float, float, float)
Interpolates between three vertices using barycentric weights, returning the vertex at that point. Convenience overload that returns the result instead of writing to an out parameter.
public static Vertex BarycentricInterpolate(in Vertex a, in Vertex b, in Vertex c, float u, float v, float w)
Parameters
Returns
Type | Description |
|---|---|
| Vertex | The interpolated vertex. |