I've got a textured 4 corner polygon that I'm currently drawing using two triangles and GL_TRIANGLE_STRIP. The right side needs to be taller, and this messes things up. There's a noticeable difference where the triangles intersect in the middle, how do I clear something like this up?
I think I need some sort of affine transform, or to subdivide into even more triangles, but I'm not sure.
screenshot: https://i.stack.imgur.com/ehW84.png
example code:
float x = rect.origin.x;
float y = rect.origin.y;
float w = x + rect.size.width;
float h = y + rect.size.height;
V2fT2f quad[4] = {
//x y
{ x, y, 0, 1 },//bottom left
{ w, y-0.2, 1, 1 },//bottom right
{ x, h, 0, 0 },//top left
{ w, h+0.2, 1, 0 },//top right
};
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_VERTEX_ARRAY);
glBindTexture(GL_TEXTURE_2D,texID);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);glErrorCheck();
glVertexPointer (2, GL_FLOAT, sizeof(V2fT2f), &quad[0].x);
glTexCoordPointer(2, GL_FLOAT, sizeof(V2fT2f), &quad[0].s);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);