-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRoom.cpp
More file actions
67 lines (57 loc) · 1.55 KB
/
Room.cpp
File metadata and controls
67 lines (57 loc) · 1.55 KB
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
#include "Room.h"
/**
* @brief Method implemented to draw the room
*/
void Room::DrawRoom() {
/// walls
glPushAttrib(GL_ALL_ATTRIB_BITS);
glShadeModel(GL_SMOOTH);
GLfloat mat_specular[] = {1.0, 0.901, 0.792, 1.0};
GLfloat mat_diffuse[] = {1.0, 0.901, 0.792, 1.0};
GLfloat mat_ambient[] = {1.0, 0.901, 0.792, 1.0};
GLfloat mat_shininess = 5.0;
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialf(GL_FRONT, GL_SHININESS, mat_shininess);
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(0,2,-10);
glScalef(10,5,thickness);
glutSolidCube(len);
glPopMatrix();
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(-10,2,0);
glScalef(thickness,5,10);
glutSolidCube(len);
glPopMatrix();
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(10,2,0);
glScalef(thickness,5,10);
glutSolidCube(len);
glPopMatrix();
glColor3d(0,0,0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(0,2,-10);
glScalef(10,5,thickness);
glutSolidCube(len);
glPopMatrix();
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(-10,2,0);
glScalef(thickness,5,10);
glutSolidCube(len);
glPopMatrix();
glPushMatrix();
glColor3d(1,0,0);
glTranslatef(10,2,0);
glScalef(thickness,5,10);
glutSolidCube(len);
glPopMatrix();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glPopAttrib();
}