Skip to content

Commit 1075a45

Browse files
authored
Update Alphabet(O).cpp
1 parent e0201e1 commit 1075a45

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

OpenGL/Alphabet(O).cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
#include <GL/glut.h>
22
#include <stdlib.h>
33
GLfloat T = 0;
4-
// void Spin()
5-
// {
6-
// T = T + 0.03;
7-
// if(T>360)
8-
// T = 0;
9-
// glutPostRedisplay();
10-
// }
114
void MyInit() {
125
glClearColor(0, 0, 0, 1);
136
glColor3f(1, 0, 0);
@@ -27,15 +20,15 @@ void Cube(GLfloat V0[], GLfloat V1[], GLfloat V2[], GLfloat V3[], GLfloat V4[],
2720
glColor3f(0.6, 0, 0.6);
2821
Face(V0, V1, V2, V3);//back
2922
glColor3f(0.5, 0.9, 0.5);
30-
Face(V4, V5, V6, V7);//front
23+
Face(V4, V5, V6, V7);
3124
glColor3f(1, 0.4, 0);
32-
Face(V0, V3, V7, V4);//left
25+
Face(V0, V3, V7, V4);
3326
glColor3f(1, 0.5, 1);
34-
Face(V1, V2, V6, V5);//right
27+
Face(V1, V2, V6, V5);
3528
glColor3f(0.5, 0.6, 1);
36-
Face(V0, V1, V5, V4);//top
29+
Face(V0, V1, V5, V4);
3730
glColor3f(0.5, 0.4, 1);
38-
Face(V2, V3, V7, V6);//bottom
31+
Face(V2, V3, V7, V6);
3932
}
4033
void Draw() {
4134
GLfloat V[8][3] = { {-0.2, 0.2, 0.3},
@@ -86,13 +79,11 @@ void Draw() {
8679
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
8780

8881
glLoadIdentity();
89-
//glRotatef(T,1,1,1);//for spinning
90-
glRotatef(3, 1, 1, -1);//for stationary
82+
glRotatef(3, 1, 1, -1);
9183
Cube(V[0], V[1], V[2], V[3], V[4], V[5], V[6], V[7]);
9284
Cube(V1[0], V1[1], V1[2], V1[3], V1[4], V1[5], V1[6], V1[7]);
9385
Cube(V2[0], V2[1], V2[2], V2[3], V2[4], V2[5], V2[6], V2[7]);
9486
Cube(V3[0], V3[1], V3[2], V3[3], V3[4], V3[5], V3[6], V3[7]);
95-
//Cube(V4[0], V4[1], V4[2], V4[3], V4[4], V4[5], V4[6], V4[7]);
9687

9788
glutSwapBuffers();
9889
}
@@ -107,7 +98,6 @@ int main(int C, char* V[])
10798
glutCreateWindow("PRATIMA");
10899
MyInit();
109100
glutDisplayFunc(Draw);
110-
//glutIdleFunc(Spin); //spinning
111101
glutMainLoop();
112102

113103
return 0;

0 commit comments

Comments
 (0)