I'm guessing you basically want fat lines? Lets assume the line is specified by two points (x0, y0)
and (x1, y1)
we then have:
float dx = x1 - x0; //delta x
float dy = y1 - y1; //delta y
float linelength = sqrtf(dx * dx + dy * dy);
dx /= linelength;
dy /= linelength;
//Ok, (dx, dy) is now a unit vector pointing in the direction of the line
//A perpendicular vector is given by (-dy, dx)
const float thickness = 5.0f; //Some number
const float px = 0.5f * thickness * (-dy); //perpendicular vector with lenght thickness * 0.5
const float py = 0.5f * thickness * dx;
glBegin(GL_QUADS);
glVertex2f(x0 - px, y0 + py);
glVertex2f(x1 - px, y1 + py);
glVertex2f(x1 + px, y1 - py);
glVertex2f(x0 + px, y0 - py);
glEnd();
Since you're using OpenGL ES I guess you'll have to convert the immediate mode rendering (glBegin
, glEnd
, etc) to glDrawElements
. You'll also have to convert the quad into two triangles.
One final thing, I'm a little tired and uncertain if the resulting quad is counterclockwise or clockwise so turn of backface culling when you try this out (glDisable(GL_CULL)
).