I need some help. I wrote to draw a circle on screen
But I need some help to edit it to make an arc.
I want to do something like, i hope this make sense.
void drawarc (double xctr, double yctr, float radius, float startAngle, float endAngle);
With it drawing an arc of a circle origin (xctr,yctr) with a radius of (radius) that draws from startAngle to endAngle
void DrawCircle(double xctr, double yctr, double radius)
//----------------------------------------------------------------------------
// Draw an unfilled circle using the current pen color, centered at (xctr,yctr)
// with radius given by 'radius'. Default pen color is black, but you can
// change it with the 'SetPenColor()' function
// Draws a circle from a bunch of short lines
{
float vectorX;
float vectorY;
float vectorY1;
float vectorX1;
float angle;
vectorY1=yctr+radius;
vectorX1=xctr;
glBegin(GL_LINE_STRIP);
for(angle=0.0f;angle<=(2.0f*3.14159);angle+=0.01f)
{
vectorX=xctr+(radius*(float)sin((double)angle));
vectorY=yctr+(radius*(float)cos((double)angle));
glVertex2d(vectorX1,vectorY1);
vectorY1=vectorY;
vectorX1=vectorX;
}
glEnd();
glFlush();
}