How can I draw a 2D crescent or moon shape in OpenGL? I have tried using sin and cos like how I did for drawing circles but because a crescent has a “cut” inside it, the sin and cos don’t look enough. I couldn’t figure out how I could do an intersection between 2 polygons either. So I’m thinking if there a mathematical formula for drawing the crescent?
Share
This isn’t mathematically correct, but it may be close enough to meet your needs:
or
At
fullness=1, it will draw a circle of sizescalewhile atfullness=-0.99f, it will draw a very thin cresent. You could use two different fullness values,rightFullnessandleftFullness, and always set one of them to1.0fso you can change the direction of the crescent.