-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·220 lines (216 loc) · 8.73 KB
/
index.html
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css">
<title>Cat Wall Clock - Computer Graphics Project</title>
<script type="text/javascript" src="libs/webgl-obj-loader.min.js"></script>
<script src="https://twgljs.org/dist/4.x/twgl-full.js"></script>
<script type="text/javascript" src="libs/utils.js"></script>
<script type="text/javascript" src="libs/view-controller.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="ObjectWrapper.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body style="background-color: grey;">
<center>
<canvas id="c" width='1024' height='768' style="background-color: gray;">
Your browser doesn't support the Canvas Element!
</canvas>
<table border="1">
<tr>
<td colspan="6">
<input id="computeGeometricalNormals" type="checkbox">Compute geometrical normals <br>
<input id="useNormalMaps" type="checkbox" checked>Use NM texture
</td>
</tr>
<tr>
<td><div style="text-align:center"><select id="lightEditNo" onchange="showLight(this.value);">
<option value="LA">Light A</option>
<option value="LB">Light B</option>
<option value="LC">Light C</option>
</select></div></td>
<th colspan="2">Diffuse</th>
<th colspan="2">Specular</th>
</tr>
<tr>
<td rowspan="6">
<div id="LA">
<table border="1">
<tr>
<td><div id="LA11"><b>Type</b></div></td>
<td><div id="LA12"><select id="LAlightType" onchange="showHideUI(this.id,this.value);">
<option value="none">None</option>
<option value="direct">Direct</option>
<option value="point">Point</option>
<option value="spot">Spot</option>
</select></div></td>
<td><div id="LA13">Color</div></td>
<td><div id="LA14"><input type="color" id="LAlightColor" value="#ffffff"></div></td>
</tr>
<tr>
<td><div id="LA21">Pos <i>x</i></div></td>
<td><div id="LA22"><input type="range" min="-250" max="250" id="LAPosX"></div></td>
<td><div id="LA23">Decay β</div></td>
<td><div id="LA24"><input type="range" min="0" max="2" id="LADecay"></div></td>
</tr>
<tr>
<td><div id="LA31">Pos <i>y</i></div></td>
<td><div id="LA32"><input type="range" min="-250" max="250" id="LAPosY"></div></td>
<td><div id="LA33">Targe dist. <i>g</i></div></td>
<td><div id="LA34"><input type="range" min="0" max="100" id="LATarget"></div></td>
</tr>
<tr>
<td><div id="LA41">Pos <i>z</i></div></td>
<td><div id="LA42"><input type="range" min="-250" max="250" id="LAPosZ"></div></td>
<td><div id="LA43">Cone <i>out</i></div></td>
<td><div id="LA44"><input type="range" min="0" max="150" id="LAConeOut"></div></td>
</tr>
<tr>
<td><div id="LA51">Dir θ</div></td>
<td><div id="LA52"><input type="range" min="0" max="180" id="LADirTheta"></div></td>
<td><div id="LA53">Cone <i>in</i></div></td>
<td><div id="LA54"><input type="range" min="0" max="100" id="LAConeIn"></div></td>
</tr>
<tr>
<td><div id="LA61">Dir φ</div></td>
<td><div id="LA62"><input type="range" min="-180" max="180" id="LADirPhi"></div></td>
<td colspan="2"> </td>
</tr>
</table>
</div>
<div id="LB" style="display:none">
<table border="1">
<tr>
<td><div id="LB11"><b>Type</b></div></td>
<td><div id="LB12"><select id="LBlightType" onchange="showHideUI(this.id,this.value);">
<option value="none">None</option>
<option value="direct">Direct</option>
<option value="point">Point</option>
<option value="spot">Spot</option>
</select></div></td>
<td><div id="LB13">Color</div></td>
<td><div id="LB14"><input type="color" id="LBlightColor" value="#ffffff"></div></td>
</tr>
<tr>
<td><div id="LB21">Pos <i>x</i></div></td>
<td><div id="LB22"><input type="range" min="-250" max="250" id="LBPosX"></div></td>
<td><div id="LB23">Decay β</div></td>
<td><div id="LB24"><input type="range" min="0" max="2" id="LBDecay"></div></td>
</tr>
<tr>
<td><div id="LB31">Pos <i>y</i></div></td>
<td><div id="LB32"><input type="range" min="-250" max="250" id="LBPosY"></div></td>
<td><div id="LB33">Targe dist. <i>g</i></div></td>
<td><div id="LB34"><input type="range" min="0" max="100" id="LBTarget"></div></td>
</tr>
<tr>
<td><div id="LB41">Pos <i>z</i></div></td>
<td><div id="LB42"><input type="range" min="-250" max="250" id="LBPosZ"></div></td>
<td><div id="LB43">Cone <i>out</i></div></td>
<td><div id="LB44"><input type="range" min="0" max="150" id="LBConeOut"></div></td>
</tr>
<tr>
<td><div id="LB51">Dir θ</div></td>
<td><div id="LB52"><input type="range" min="0" max="180" id="LBDirTheta"></div></td>
<td><div id="LB53">Cone <i>in</i></div></td>
<td><div id="LB54"><input type="range" min="0" max="100" id="LBConeIn"></div></td>
</tr>
<tr>
<td><div id="LB61">Dir φ</div></td>
<td><div id="LB62"><input type="range" min="-180" max="180" id="LBDirPhi"></div></td>
<td colspan="2"> </td>
</tr>
</table>
</div>
<div id="LC" style="display:none">
<table border="1">
<tr>
<td><div id="LC11"><b>Type</b></div></td>
<td><div id="LC12"><select id="LClightType" onchange="showHideUI(this.id,this.value);">
<option value="none">None</option>
<option value="direct">Direct</option>
<option value="point">Point</option>
<option value="spot">Spot</option>
</select></div></td>
<td><div id="LC13">Color</div></td>
<td><div id="LC14"><input type="color" id="LClightColor" value="#ffffff"></div></td>
</tr>
<tr>
<td><div id="LC21">Pos <i>x</i></div></td>
<td><div id="LC22"><input type="range" min="-250" max="250" id="LCPosX"></div></td>
<td><div id="LC23">Decay β</div></td>
<td><div id="LC24"><input type="range" min="0" max="2" id="LCDecay"></div></td>
</tr>
<tr>
<td><div id="LC31">Pos <i>y</i></div></td>
<td><div id="LC32"><input type="range" min="-250" max="250" id="LCPosY"></div></td>
<td><div id="LC33">Targe dist. <i>g</i></div></td>
<td><div id="LC34"><input type="range" min="0" max="100" id="LCTarget"></div></td>
</tr>
<tr>
<td><div id="LC41">Pos <i>z</i></div></td>
<td><div id="LC42"><input type="range" min="-250" max="250" id="LCPosZ"></div></td>
<td><div id="LC43">Cone <i>out</i></div></td>
<td><div id="LC44"><input type="range" min="0" max="150" id="LCConeOut"></div></td>
</tr>
<tr>
<td><div id="LC51">Dir θ</div></td>
<td><div id="LC52"><input type="range" min="0" max="180" id="LCDirTheta"></div></td>
<td><div id="LC53">Cone <i>in</i></div></td>
<td><div id="LC54"><input type="range" min="0" max="100" id="LCConeIn"></div></td>
</tr>
<tr>
<td><div id="LC61">Dir φ</div></td>
<td><div id="LC62"><input type="range" min="-180" max="180" id="LCDirPhi"></div></td>
<td colspan="2"> </td>
</tr>
</table>
</div>
</td>
<td><div id="D11"><b>Type</b></div></td>
<td><div id="D12"><select id="diffuseType" onchange="showHideUI(this.id,this.value);">
<option value="none">None</option>
<option value="lambert">Lambert</option>
<option value="toon">Toon</option>
</select></div></td>
<td><div id="S11"><b>Type</b></div></td>
<td><div id="S12"><select id="specularType" onchange="showHideUI(this.id,this.value);">
<option value="none">None</option>
<option value="phong">Phong</option>
<option value="blinn">Blinn</option>
<option value="toonP">Toon (Phong)</option>
<option value="toonB">Toon (Blinn)</option>
</select></div></td>
</tr>
<tr>
<td><div id="D21">Color</div></td>
<td><div id="D22"><input type="color" id="diffuseColor" value="#00ffff"></div></td>
<td><div id="S21">Color</div></td>
<td><div id="S22"><input type="color" id="specularColor" value="#ffffff"></div></td>
</tr>
<tr>
<td><div id="D31">Texture</div></td>
<td><div id="D32"><input type="range" min="0" max="100" id="DTexMix"></div></td>
<td><div id="S31">Shiny γ</div></td>
<td><div id="S32"><input type="range" min="1" max="200" id="SpecShine"></div></td>
</tr>
<tr>
<td><div id="D41">Toon thr.</div></td>
<td><div id="D42"><input type="range" min="0" max="100" id="DToonTh"></div></td>
<td><div id="S41">Toon thr.</div></td>
<td><div id="S42"><input type="range" min="0" max="100" id="SToonTh"></div></td>
</tr>
<tr>
<tr>
<td colspan="2">
<div style="text-align:center">
<span onclick="resetShaderParams();">Reset</span>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>