Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (angle1 >= 360)
- angle1 = 0;
- if (angle2 >= 360)
- angle2 = 0;
- if (angle3 >= 360)
- angle3 = 0;
- angle1 += 0.04f;
- angle2 += 0.01f;
- angle3 += 0.006f;
- //SΕONCE
- glColor3f(1,1,0);
- glutWireSphere(0.4,30,30);
- //ORBITA 1
- glColor3f(1,1,1);
- glutWireTorus(0.01,1,10,40);
- //PLANETA 1
- glPushMatrix();
- glRotatef(angle1,0,0,1);
- glTranslatef(1,0,0);
- glColor3f(1,0,0);
- glutWireSphere(0.1,30,30);
- glPopMatrix();
- //ORBITA 2
- glColor3f(1,1,1);
- glutWireTorus(0.01,1.5,10,40);
- //PLANETA 2
- glPushMatrix();
- glRotatef(angle2,0,0,1);
- glTranslatef(1.5,0,0);
- glColor3f(0,1,0);
- glutWireSphere(0.2,30,30);
- glPopMatrix();
- //ORBITA 3
- glColor3f(1,1,1);
- glutWireTorus(0.01,2.1,10,40);
- //PLANETA 3
- glPushMatrix();
- glRotatef(angle3,0,0,1);
- glTranslatef(2.1,0,0);
- glColor3f(0,0,1);
- glPushMatrix();
- glRotatef(angle3*8,0,0,1);
- glutWireSphere(0.26,30,30);
- glPopMatrix();
- glPopMatrix();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement