include material3d Material3D Material3D ambient Color3D 2f 2f 2f 0f d

 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
#include "material3d.h"
Material3D::Material3D()
{
ambient = Color3D(0.2f, 0.2f, 0.2f, 1.0f);
diffuse = Color3D(0.8f, 0.8f, 0.8f, 1.0f);
emission = Color3D(0.0f, 0.0f, 0.0f, 1.0f);
specular = Color3D(0.0f, 0.0f, 0.0f, 1.0f);
shininess = 0.0f;
}
Material3D::Material3D(Color3D ambient,
Color3D diffuse,
Color3D emission,
Color3D specular,
GLfloat shininess)
{
this->ambient = ambient;
this->diffuse = diffuse;
this->emission = emission;
this->specular = specular;
this->shininess = shininess;
}
Material3D Material3D::Red = Material3D(Color3D::Red,
Color3D(0.8f, 0.8f, 0.8f, 1.0f),
Color3D(0.0f, 0.0f, 0.0f, 1.0f),
Color3D(0.6f, 0.6f, 0.6f, 1.0f),
100.0f);
Material3D Material3D::Green = Material3D(Color3D::Green,
Color3D(0.8f, 0.8f, 0.8f, 1.0f),
Color3D(0.0f, 0.0f, 0.0f, 1.0f),
Color3D(0.6f, 0.6f, 0.6f, 1.0f),
100.0f);
Material3D Material3D::Blue = Material3D(Color3D::Blue,
Color3D(0.8f, 0.8f, 0.8f, 1.0f),
Color3D(0.0f, 0.0f, 0.0f, 1.0f),
Color3D(0.6f, 0.6f, 0.6f, 1.0f),
100.0f);