Skip to content

Instantly share code, notes, and snippets.

@celsocelante
Created September 13, 2017 01:06
Show Gist options
  • Save celsocelante/869ebb681fb8c11480a591a05a3f4512 to your computer and use it in GitHub Desktop.
Save celsocelante/869ebb681fb8c11480a591a05a3f4512 to your computer and use it in GitHub Desktop.
if(circ.getDisplayed()) {
glClear(GL_COLOR_BUFFER_BIT);
GLfloat twicePi = 2.0f * M_PI;
glEnable(GL_LINE_SMOOTH);
glLineWidth(0.001);
glBegin(GL_LINES);
glColor4f(1.0, 1, 1, 1.0);
for(int i = 0; i <= 1000; i++) {
glVertex3f(circ.getX(), circ.getY(), 0);
glVertex3f(circ.getX() + (circ.getRadius() * cos(i * twicePi / 1000)),
circ.getY() + (circ.getRadius() * sin(i * twicePi / 1000)), 0);
}
glEnd();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment