-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChaleiraMaluca.h
70 lines (66 loc) · 1.64 KB
/
ChaleiraMaluca.h
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
61
62
63
64
65
66
67
68
69
70
#define PI 3.1415
//só funcoes basicas para desenhar as estruturas
void desenhaBase2(){
glColor3f(0.6,0.6,0.6);
glPushMatrix();
glRotated(270,1,0,0);
glutSolidCylinder(3.5,0.5,10.0,10.0);
glPopMatrix();
}
void desenhaPilar(){
glColor3f(1.0,0.0,0.0);
glPushMatrix();
glRotated(270,1,0,0);
glutSolidCylinder(0.5,3.0,10.0,10.0);
glPopMatrix();
}
void desenhaChaleira(int rotacaoXicara){
glColor3f(0.8,0.0,0.8);
glPushMatrix();
glTranslated(0.0,3.5,0.0);
glRotated(-rotacaoXicara,0,1,0);
glutSolidTeapot(1.0);
glPopMatrix();
}
void desenhaJogodeXicaras(){
glColor3f(0.8,0.0,0.8);
glPushMatrix();
glTranslated(1.0,0.5,0.0);
glRotated(0,0,1,0);
glutSolidTeapot(1.0);
glPopMatrix();
glPushMatrix();
glTranslated(2.0,0.5,0.0);
glRotated(180,0,1,0);
glutSolidTeapot(1.0);
glPopMatrix();
glPushMatrix();
glTranslated(1.5,0.5,0.5);
glRotated(90,0,1,0);
glutSolidTeapot(1.0);
glPopMatrix();
glPushMatrix();
glTranslated(1.5,0.5,-0.5);
glRotated(270,0,1,0);
glutSolidTeapot(1.0);
glPopMatrix();
}
void desenhaXicaras(){
for(double i=0;i<=2;i+=0.5){
glPushMatrix();
glTranslated((2*cos(i*PI))-1.5,0.0,(2*sin(i*PI)));
desenhaJogodeXicaras();
glPopMatrix();
}
}
void desenhaChaleiraMaluca(int rotacaoXicara){
glPushMatrix();
desenhaBase2();
glPushMatrix();
glRotated(rotacaoXicara,0,1,0);
desenhaPilar();
desenhaXicaras();
glPopMatrix();
desenhaChaleira(rotacaoXicara);
glPopMatrix();
}