1
| | GLfloat r = 5.0f;
GLfloat depth = -5.0f;
unsigned int subdivisions = 1000;
GLfloat angle = 360.0f/(float)subdivisions;
GLfloat rads = GLfloat(PI / 180.0f);
GLfloat theta;
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(GL_TRIANGLE_FAN);
glVertex3f(0.0f, 0.0f, depth);
for(unsigned int x = 0; x < subdivisions+1; ++x)
{
theta = (x * angle * rads);
glVertex3f( r*sin(theta),
r*cos(theta),
depth);
}
glEnd(); |