-
Notifications
You must be signed in to change notification settings - Fork 0
/
material.h
53 lines (44 loc) · 2.03 KB
/
material.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: color.h
* Author: deboramorita
*
* Created on March 16, 2017, 6:25 PM
*/
#ifndef MATERIAL_H
#define MATERIAL_H
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#else
#include <GL/gl.h>
#endif
#include <vector>
using namespace std;
namespace Material {
class Material {
public:
vector<GLfloat> specular;
vector<GLfloat> ambient;
vector<GLfloat> diffuse;
vector<GLfloat> shininess;
Material();
Material(const GLfloat*, const GLfloat*, const GLfloat*, const GLfloat*);
virtual ~Material();
void apply();
private:
};
// Defining materials
const Material white((GLfloat[]){1, 1, 1, 1}, (GLfloat[]) {1, 1, 1, 1}, (GLfloat[]) {1, 1, 1, 1}, (GLfloat[]) {128 * 0.4});
const Material grey((GLfloat[]){0.75, 0.75, 0.75, 1}, (GLfloat[]) {0.5, 0.5, 0.5, 1.0}, (GLfloat[]) {0.5, 0.5, 0.5, 1}, (GLfloat[]) {128 * 0.6});
const Material blue((GLfloat[]){0.75, 0.75, 0.75, 1}, (GLfloat[]) {0, 0, 1, 1}, (GLfloat[]) {0.5, 0.5, 0.5, 1}, (GLfloat[]) {128});
const Material green((GLfloat[]){0.633, 0.727811, 0.633, 1}, (GLfloat[]) {0.0215, 0.1745, 0.0215, 1}, (GLfloat[]) {0.07568, 0.61424, 0.07568, 1}, (GLfloat[]) {128});
const Material yellow((GLfloat[]){0.75, 0.75, 0.75, 1.0}, (GLfloat[]) {1, 1, 0, 1}, (GLfloat[]) {0.5, 0.5, 0.5, 1}, (GLfloat[]) {128});
const Material red((GLfloat[]){0.75, 0.75, 0.75, 1.0}, (GLfloat[]) {1, 0, 0, 1}, (GLfloat[]) {0.8, 0.5, 0.5, 1}, (GLfloat[]) {128});
const Material bronze((GLfloat[]){0.774597, 0.458561, 0.200621, 1.0}, (GLfloat[]) {0.25, 0.148, 0.06475, 1}, (GLfloat[]) {0.4, 0.2368, 0.1036, 1}, (GLfloat[]) {76.8});
const Material tin((GLfloat[]){0.333333, 0.333333, 0.521569, 1.0}, (GLfloat[]) {0.105882, 0.058824, 0.113725, 1}, (GLfloat[]) {0.427451, 0.470588, 0.541176, 1}, (GLfloat[]) {9.84615});
}
#endif /* MATERIAL_H */