forked from carboned4/CeGue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlackWall.h
99 lines (88 loc) · 2.67 KB
/
BlackWall.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef BLACKWALL_H
#define BLACKWALL_H
#include "glut.h"
#include "Entity.h"
class BlackWall : public Entity {
public:
BlackWall(){
setPosition(0.0, 6.5, 0.0);
}
~BlackWall(){}
void draw(){
Vector3 vector = getPosition();
GLfloat mat_specular[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat mat_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat shininess = 5;
glPushMatrix();
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialf(GL_FRONT, GL_SHININESS, shininess);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_ambient);
glTranslatef(vector.getX(), vector.getY(), vector.getZ());
glPushMatrix();
glTranslatef(0.0, -7.0, -1.0);
glColor3f(0.0, 0.0, 0.0);
glPushMatrix();
glTranslatef(-5.5, 0.0, 0.0);
glBegin(GL_TRIANGLES); //SITIO POR ONDE DESAPARECEM OS CARROS
glVertex3f(0, 0, 0); //perto, a superficie |_\.
glVertex3f(0, 13.0, 0); //longe, a superficie
glVertex3f(0, 0, 10.0); //perto, no ar
glEnd();
glBegin(GL_TRIANGLES);
glVertex3f(0, 0, 10.0);
glVertex3f(0, 13.0, 0);
glVertex3f(0, 13.0, 10.0);
glEnd();
glBegin(GL_TRIANGLES); //PARA TAPAR OS CARROS QUE JA DESAPARECERAM
glVertex3f(0, 0, 0); //perto, a superficie |_\.
glVertex3f(0, 0, 10.0); //perto, no ar
glVertex3f(-5.0, 0, 0); //longe, a superficie
glEnd();
glBegin(GL_TRIANGLES);
glVertex3f(0, 0, 10.0);
glVertex3f(-5.0, 0.0, 10);
glVertex3f(-5.0, 0.0, 0.0);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(5.5, 0.0, 0.0);
glBegin(GL_TRIANGLES); //SITIO POR ONDE APARECEM OS CARROS
glVertex3f(0, 0, 0); //perto, a superficie |_\.
glVertex3f(0, 13.0, 0); //longe, a superficie
glVertex3f(0, 0, 10.0); //perto, no ar
glEnd();
glBegin(GL_TRIANGLES);
glVertex3f(0, 0, 10.0);
glVertex3f(0, 13.0, 0);
glVertex3f(0, 13.0, 10.0);
glEnd();
glBegin(GL_TRIANGLES); //PARA TAPAR OS CARROS QUE AINDA NAO APARECERAM
glVertex3f(0, 0, 0); //perto, a superficie |_\.
glVertex3f(5.0, 0.0, 0); //longe, a superficie
glVertex3f(5.0, 0, 10.0); //perto, no ar
glEnd();
glBegin(GL_TRIANGLES);
glVertex3f(5.0, 0, 10.0);
glVertex3f(0, 0.0, 10.0);
glVertex3f(0, 0.0, 0.0);
glEnd();
glPopMatrix();
glPopMatrix();
glPushMatrix();
glTranslatef(0.0, 6, -1.0); // PAREDE DO FUNDO
glBegin(GL_TRIANGLES);
glVertex3f(-5.5, 0, 0); //esq inf |_\.
glVertex3f(5.5, 0, 0); //dir inf
glVertex3f(-5.5, 0, 10.0); //esq sup
glEnd();
glBegin(GL_TRIANGLES);
glVertex3f(5.5, 0, 0);
glVertex3f(5.5, 0.0, 10.0);
glVertex3f(-5.5, 0.0, 10.0);
glEnd();
glPopMatrix();
glPopMatrix();
}
};
#endif