glClipPlanef is used for cliping textures with planes.
Using glClipPlanef example:
const GLfloat v[] = {
A, B, C, -D
};
// bind to clip plane
glClipPlanef(GL_CLIP_PLANE0, v);
// enabled it
glEnable(GL_CLIP_PLANE0);
// some draw logic
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
// clip area
glDisable(GL_CLIP_PLANE0);
where A, B, C, D — parameters of plane equation.
If we have three points with coords (x1,y1,z1), (x2,y2,z2), (x3,y3,z3) then
A = y1 * (z2 - z3) + y2 (z3 - z1) + y3 (z1 - z2)
B = z1 * (x2 - x3) + z2 (x3 - x1) + z3 (x1 - x2)
C = x1 * (y2 - y3) + x2 (y3 - y1) + x3 (y1 - y2)
-D = x1 * (y2*z3 - y3*z2) + x2 * (y3*z1 - y1*z3) + x3 * (y1*z2 - y2*z1)
If you have 2D texture you'll need to define points as follows: (x1, y1, 0), (x2, y2, 0 and (x3, y3, 1). This will work.