HI all.
I have a problem regarding how to drawing a crescent using opengl. i recently learn this opengl so i dont have much idea how to do it, here is what i have so far.
void drawCrescentTriStrip(float step,float scale,float fullness) {
glBegin(GL_TRIANGLE_STRIP);
glColor3f(1.0, 1.0, 0.0);
// glVertex2f(0.9f,scale);
const float pi = 3.1415926535897932384626433832795;
float angle=step;
while (angle<pi) {
float sinAngle=sinf(angle);
float cosAngle=cosf(angle);
glVertex2f(scale*sinAngle,scale*cosAngle);
glVertex2f(-fullness*scale*sinAngle,scale*cosAngle);
angle+=step;
}
glVertex2f(0.9f,-scale);
glEnd();
}
i dont have strong math, so i hope i can get help as much as possible for me to learn about opengl.
thanks.