Skip to content

Instantly share code, notes, and snippets.

@clone1018
Created November 1, 2012 21:29
Show Gist options
  • Save clone1018/3996715 to your computer and use it in GitHub Desktop.
Save clone1018/3996715 to your computer and use it in GitHub Desktop.
//filled circle
float x1,y1,x2,y2;
float angle;
double radius=0.1;
x1 = 0.5,y1=0.6;
glColor3f(1.0,1.0,0.6);
glBegin(GL_TRIANGLE_FAN);
glVertex2f(x1,y1);
for (angle=1.0f;angle<361.0f;angle+=0.2)
{
x2 = x1+sin(angle)*radius;
y2 = y1+cos(angle)*radius;
glVertex2f(x2,y2);
}
glEnd();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment