-
Notifications
You must be signed in to change notification settings - Fork 0
/
CIRCLE ANIMATION
60 lines (43 loc) · 857 Bytes
/
CIRCLE ANIMATION
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <windows.h>
#include<stdio.h>
#include<GL/glut.h>
#include<math.h>
int x, y;
float i, j;
void myInit (void)
{
glClearColor(0.0, 0.0, 0.0, 1.0);
glColor3f(0.0, 1.0, 0.0);
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(-780, 780, -420, 420);
}
void display (void)
{
for (j = 0; j < 10000; j += 0.01)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
for (i = 0;i < 6.29;i += 0.001)
{
x = 200 * cos(i);
y = 200 * sin(i);
glVertex2i(x, y);
glVertex2i(x/2-200*cos(j),y/2-200*sin(j));
}
glEnd();
glFlush();
}
}
int main (int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(1360, 768);
glutInitWindowPosition(0, 0);
glutCreateWindow("Revolution");
myInit();
glutDisplayFunc(display);
glutMainLoop();
}