-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFloor.cpp
More file actions
34 lines (31 loc) · 928 Bytes
/
Floor.cpp
File metadata and controls
34 lines (31 loc) · 928 Bytes
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
#include "Floor.h"
/**
* Method implemented to draw the floor and ceiling
*/
void Floor::DrawFloor() {
glPushAttrib(GL_ALL_ATTRIB_BITS);
glShadeModel(GL_SMOOTH);
GLfloat mat_specular[] = {0.976, 0.952, 0.952, 1.0};
GLfloat mat_diffuse[] = {0.976, 0.952, 0.952, 1.0};
GLfloat mat_ambient[] = {0.976, 0.952, 0.952, 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);
/// Floor
glPushMatrix();
glColor3d(1,1,1);
glTranslatef(0,-3,0);
glScalef(10,thickness,10);
glutSolidCube(len);
glPopMatrix();
/// Ceiling
glPushMatrix();
glColor3d(1,1,1);
glTranslatef(0,7,0);
glScalef(10,thickness,10);
glutSolidCube(len);
glPopMatrix();
glPopAttrib();
}