Checks whether the given triangle t
contains the point p
.
a #graphene_point3d_t
Checks whether the two given #graphene_triangle_t are equal.
a #graphene_triangle_t
Frees the resources allocated by graphene_triangle_alloc().
Computes the area of the given #graphene_triangle_t.
Computes the barycentric coordinates
of the given point p
.
The point p
must lie on the same plane as the triangle t;
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 #graphene_vec2_t contains the following values, in order:
res.x = u
res.y = v
a #graphene_point3d_t
Computes the plane based on the vertices of the given #graphene_triangle_t.
Computes the UV coordinates of the given point p
.
The point p
must lie on the same plane as the triangle t;
if the point
is not coplanar, the result of this function is undefined. If p
is %NULL,
the point will be set in (0, 0, 0).
The UV coordinates will be placed in the res
vector:
res.x = u
res.y = v
See also: graphene_triangle_get_barycoords()
a #graphene_point3d_t
the UV coordinates of the first point
the UV coordinates of the second point
the UV coordinates of the third point
Initializes a #graphene_triangle_t using the three given arrays of floating point values, each representing the coordinates of a point in 3D space.
an array of 3 floating point values
an array of 3 floating point values
an array of 3 floating point values
Allocates a new #graphene_triangle_t.
The contents of the returned structure are undefined.
A triangle.