-
Notifications
You must be signed in to change notification settings - Fork 0
/
Materials.s3d
104 lines (91 loc) · 2.19 KB
/
Materials.s3d
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
100
101
102
103
104
#ifndef _MATERIALS
#define _MATERIALS
/*Colors & mat */
var m_white = null;
var m_black = null;
var m_red = null;
var m_green = null;
var m_blue = null;
var m_hl = null;
function MGetWhite()
{
if(m_white == null)
{
m_white = CVmMaterial();
m_white.ambient = [0.5, 0.5, 0.4, 1.0]; //white
m_white.diffuse = [0.9, 0.9, 0.88, 1.0];
m_white.specular = [0.1, 0.1, 0.15, 0];
m_white.shininess = 10;
//m_white.SetTexture(CVmTexture("w_wood.jpg", NULL),0);
}
return m_white;
}
function MGetBlack()
{
if(m_black == null)
{
m_black = CVmMaterial();
m_black.ambient = [0.1, 0.1, 0.1, 1.0]; //black
m_black.diffuse = [0.1, 0.1, 0.1, 1.0];
m_black.specular = [0.2, 0.1, 0.1, 0.5];
//m_black.emission = [1.0, 1.0, 0, 1];
m_black.shininess = 10;
//m_black.transparency = 0.5;
}
return m_black;
}
function MGetHl()
{
if(m_hl == null)
{
m_hl = CVmMaterial();
m_hl.ambient = [0.5, 0.5, 0.5, 1.0]; //yellow
m_hl.diffuse = [1, 1, 0.1, 1.0];
m_hl.specular = [0.1, 0.1, 0.1, 0.5];
m_hl.emission = [0.5, 0.5, 0.5];
m_hl.shininess = 0;
}
return m_hl;
}
function MGetBlue()
{
if(m_blue == null)
{
m_blue = CVmMaterial();
m_blue.ambient = [0.0, 0.0, 0.2, 1.0]; //blue
m_blue.diffuse = [0.0, 0.0, 1.0, 1.0];
m_blue.specular = [0.1, 0.1, 0.1, 1.0];
m_blue.shininess = 10;
//palm.ForceMaterial(mat);
//palm.ModulateMaterials(c_blue);
}
return m_blue;
}
function MGetGreen()
{
if(m_green == null)
{
m_green = CVmMaterial();
m_green.ambient = [0.0, 0.2, 0.0, 1.0]; //green
m_green.diffuse = [0.0, 1.0, 0.0, 1.0];
m_green.specular = [0.1, 0.1, 0.1, 1.0];
m_green.shininess = 7;
//f0.ForceMaterial(f0_mat);
//f0.ModulateMaterials(c_green);
}
return m_green;
}
function MGetRed()
{
if(m_red == null)
{
m_red = CVmMaterial();
m_red.ambient = [0.2, 0.0, 0.0, 1.0]; //red
m_red.diffuse = [1.0, 0.0, 0.0, 1.0];
m_red.specular = [0.1, 0.1, 0.1, 1.0];
m_red.shininess = 7;
//f1.ModulateMaterials(c_red);
}
return m_red;
}
#endif