In OpenGL, how can I draw a given percentage of the outline of a circle? And how can I control the thickness of that outline?
Example: If the percentage is 100, then the outline of a full circle should be drawn. If the percentage is 50, the outline of half a circle should be drawn.
I've tried the following, but the problem there is that it completes the lineloop, leading to a line connecting the startpoint and endpoint of the circle outline. Additionally, it does not seam to let me change the thickness of the outline.
glBegin(GL_LINE_LOOP);
for (int i=0; i < (360/10*percent/10); i++) {
float degInRad = i*DEG2RAD;
glVertex2f(a+cos(degInRad)*r,b+sin(degInRad)*r);
}
glEnd();
I am tempted to just make my circle up of GL_POINTS, but I was wondering if there is a better way?