- float t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
- float a = t*90.0;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glTranslatef(-2.4,1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutSolidSphere(1,slices,stacks);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(0,1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutSolidCone(1,1,slices,stacks);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(2.4,1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutSolidTorus(0.2,0.8,slices,stacks);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(-2.4,-1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutWireSphere(1,slices,stacks);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(0,-1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutWireCone(1,1,slices,stacks);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(2.4,-1.2,-6);
- glRotatef(60,1,0,0);
- glRotatef(a,0,0,1);
- glColor3f(1,0,0);
- glutWireTorus(0.2,0.8,slices,stacks);
- glPopMatrix();
-
- glutSwapBuffers();
+ const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
+ const double a = t*90.0;
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glColor3d(1,0,0);
+
+ glPushMatrix();
+ glTranslated(-2.4,1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutSolidSphere(1,slices,stacks);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslated(0,1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutSolidCone(1,1,slices,stacks);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslated(2.4,1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutSolidTorus(0.2,0.8,slices,stacks);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslated(-2.4,-1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutWireSphere(1,slices,stacks);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslated(0,-1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutWireCone(1,1,slices,stacks);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslated(2.4,-1.2,-6);
+ glRotated(60,1,0,0);
+ glRotated(a,0,0,1);
+ glutWireTorus(0.2,0.8,slices,stacks);
+ glPopMatrix();
+
+ glutSwapBuffers();