1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#ifndef _FONTS_H_H
#define _FONTS_H_H
#define PI 3.1415926535898
GLint circle_points = 145445;
void MyCircle2f(GLfloat centerx, GLfloat centery, GLfloat radius){
GLint i;
GLdouble angle;
glBegin(GL_POLYGON);
for (i = 0; i < circle_points; i++) {
angle = 2*PI*i/circle_points;
glVertex2f(centerx+radius*cos(angle), centery+radius*sin(angle));
}
glEnd();
}
GLfloat RadiusOfBall = 15.;
// Draw the ball, centered at the origin
static void draw_ball() {
glColor3f(0.6,0.3,0.);
MyCircle2f(0.,0.,RadiusOfBall);
}
static void draw_ball2() {
glColor3f(0.0,0.0,1.0);
MyCircle2f(0.,0.,RadiusOfBall);
}
static void draw_ball3() {
glColor3f(0.0,1.0,0.);
MyCircle2f(0.,0.,RadiusOfBall);
}
static void draw_ball4() {
glColor3f(1.0,0.0,0.);
MyCircle2f(0.,0.,RadiusOfBall);
}
#endif
|