-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
323 lines (317 loc) · 12.4 KB
/
Copy pathindex.html
File metadata and controls
323 lines (317 loc) · 12.4 KB
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Project: LOD</title>
<link type="text/css" rel="stylesheet" href="index.css">
</head>
<body onload="CULLING.main();">
<table id="statistics">
<tr>
<td class="info">Count of triangles: </td>
<td id="triangles" class="info info_value">0</td>
<td class="info">Frame time: </td>
<td id="time" class="info">0</td>
<td class="info info_value">ms</td>
<!-- <td class="info">Incoming: </td><td id="incoming" class="info info_value">0</td> -->
</tr>
<tr>
<td id="posX" class="info">x: 0.0</td>
<td id="posY" class="info">y: 0.0</td>
<td id="posZ" class="info">z: 0.0</td>
</tr>
<tr>
<td class="info">Culling method: </td>
<td id="culling" class="info info_value">No culling</td>
<td class="info">Hierarchy: </td>
<td id="hierarchy" class="info">false</td>
</tr>
</table>
<table id="lod_info">
<tr>
<td id="furniture_id" class="info info_value">Model ID: 0</td>
<td class="info info_value">
<div id="lod_info_level" class="lod_element">Level: 0</div>
</td>
<td id="furniture_area" class="info info_value"></td>
<td colspan="2">
<button onclick="LOD.exportCurLOD()">Export</button>
<button class="lod_element" onclick="DOM.lodConfigImport.toggle('fade')">Replace LOD</button>
<button class="non_lod_element" onclick="LOD.addCurLOD()">Create LOD</button>
</td>
</tr>
<tr>
<td id="furniture_posX" class="info info_value">x: 0.0</td>
<td id="furniture_posY" class="info info_value">y: 0.0</td>
<td id="furniture_posZ" class="info info_value">z: 0.0</td>
<td id="furniture_dist" class="info info_value">dist: 0.0</td>
<td class="info_value"></td>
</tr>
<tr class='lod_element'>
<td class="info">Triangles: </td>
<td id="lod_info_triangles" class="info info_value">0</td>
<td class="info">Selection method: </td>
<td id="lod_info_select" class="info info_value">Range based</td>
</tr>
</table>
<canvas id="myWebGLCanvas" width="1024" height="1024"></canvas>
<canvas id="topCanvas" width="512" height="512"></canvas>
<img id="map_arrow" src="img/arrow.png" width="512" height="512" />
<!-- <img id="title" class="intro"/> -->
<!-- <img id="play_game" class="play" onclick="GAME.play()"/> -->
<!-- <img id="pause_game" class="play" onclick="GAME.pause()"/> -->
<p>
<b>To control this program, use the following key:</b><br>
a — translate view left along view X<br>
d — translate view right along view X<br>
w — translate view forward along view Z<br>
s — translate view backward along view Z<br>
q — translate view up along view Y<br>
e — translate view down along view Y<br>
A — rotate view left around view Y (yaw)<br>
D — rotate view right around view Y (yaw)<br>
<!-- W — rotate view forward around view X (pitch)<br>
S — rotate view backward around view X (pitch)<br>
Q — rotate view forward around view Z (roll)<br>
E — rotate view backward around view Z (roll)<br> -->
1 — Render without culling<br>
2 — Render with frustum culling<br>
3 — Render with portal culling<br>
h — toggle hierarchical culling<br>
j — Zoom in top down view<br>
k — Zoom out top down view<br>
m — toggle map view<br>
n — toggle model view<br>
c — toggle ceiling<br>
</p>
<div id='config_right'>
<div id="navigate">
<h3>Navigation configuration</h3>
<table>
<tr>
<td><b>Moving speed:</b></td>
<td>
<input id="navigate_config_trans" class="nav_range" type="range" min="-3" max="-0.4" step="0.2">
</td>
</tr>
<tr>
<td><b>Rotation speed:</b></td>
<td>
<input id="navigate_config_rot" class="nav_range" type="range" min="-3" max="-0.4" step="0.2">
</td>
</tr>
</table>
</div>
<div id='lod_config' class='lod_element'>
<h3>LOD configuration</h3>
<table>
<tr>
<td><b>LOD switching method:</b></td>
<td>
<input type="radio" id='lod_config_switch_discrete' name='lod_config_switch_method' value='discrete'>
Discrete switching
</td>
<td>
<input type="radio" id='lod_config_switch_blend' name='lod_config_switch_method' value='blend'>
Alpha blending switching
</td>
</tr>
</table>
<table>
<tr>
<td><b>LOD selection method:</b></td>
<td>
<input type="radio" id='lod_config_select_range' name='lod_config_select_method' value='range'>
Range based
</td>
<td>
<input type="radio" id='lod_config_select_area' name='lod_config_select_method' value='area'>
Area based
</td>
<td>
<input type="radio" id='lod_config_select_manual' name='lod_config_select_method' value='manual'>
Manual select
</td>
</tr>
</table>
<table>
<tr id='lod_config_range_bound'>
<div>
<td>
<b>Range based boundary: </b>
</td>
<td>
Boundary 0-1:
<input type="number" id='lod_config_range_00' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_range_01' class='numInput' min='0' step='1'>
Boundary 1-2:
<input type="number" id='lod_config_range_10' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_range_11' class='numInput' min='0' step='1'>
Boundary 2-3:
<input type="number" id='lod_config_range_20' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_range_21' class='numInput' min='0' step='1'>
</td>
</div>
</tr>
<tr id='lod_config_area_bound'>
<div>
<td>
<b>Area based boundary: </b>
</td>
<td>
Boundary 0-1:
<input type="number" id='lod_config_area_00' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_area_01' class='numInput' min='0' step='1'>
Boundary 1-2:
<input type="number" id='lod_config_area_10' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_area_11' class='numInput' min='0' step='1'>
Boundary 2-3:
<input type="number" id='lod_config_area_20' class='numInput' min='0' step='1'> -
<input type="number" id='lod_config_area_21' class='numInput' min='0' step='1'>
</td>
</div>
</tr>
<tr id='lod_config_manual_bound'>
<div>
<td>
<b>Manual select level: </b>
</td>
<td>
<input type="number" id='lod_config_manual_level' class='numInput' min='0' max='3' step='1'>
</td>
</div>
</tr>
</table>
<div id='lod_config_import'>
<table>
<tr>
<td><b>Replace LOD model:</b></td>
<td>
<input type="radio" id='lod_config_import_method_file' name='lod_config_import_method' value="file">
From JSON file
</td>
<td>
<input type="radio" id='lod_config_import_method_text' name='lod_config_import_method' value="text">
From JSON text
</td>
<td>
<input type="radio" id='lod_config_import_method_VC' name='lod_config_import_method' value="vertex">
Generate by vertex clustering
</td>
</tr>
</table>
<div id='lod_config_import_text'>
<textarea id="lod_config_import_text_code" cols="80" rows="40"></textarea><br>
<button onclick="EVENTS.handleImportFromText()">Submit</button>
</div>
<div id='lod_config_import_file'>
<input type="file" id="lod_config_import_file_path">
<button onclick="EVENTS.handleImportFromFile()">Submit</button>
</div>
<div id='lod_config_import_VC'>
<div>
<b>Cluster number</b>: X dimension:
<input type="number" id='lod_config_import_VC_nx' class='numInput' min='1' step='1'>
Y dimension:
<input type="number" id='lod_config_import_VC_ny' class='numInput' min='1' step='1'>
Z dimension:
<input type="number" id='lod_config_import_VC_nz' class='numInput' min='1' step='1'>
</div>
<div>
<button onclick="EVENTS.handleImportVertexClustering()">Generate</button>
<button onclick="EVENTS.handleImportVertexClusteringSplit()">Generate with normal split</button>
</div>
</div>
</div>
</div>
</div>
<!-- <button class="test" onclick="GAME.test()">Test</button>
<table class="config">
<tr>
<td></td>
<td><input type="checkbox" id="UseLight" onchange="RASTERIZE.refresh()" checked>Use Light</td>
<td></td>
<td><button onclick="RASTERIZE.refresh()">Set Parameters</button></td>
</tr>
<tr>
<th>Canvas</th>
</tr>
<tr>
<td>Width</td>
<td><input type="number" id="Width" value="1024"></td>
<td>Height</td>
<td><input type="number" id="Height" value="1024"></td>
</tr>
<tr>
<th>Window</th>
</tr>
<tr>
<td>Left</td>
<td><input type="number" id="WLeft" value="-0.01"></td>
<td>Right</td>
<td><input type="number" id="WRight" value="0.01"></td>
</tr>
<tr>
<td>Bottom</td>
<td><input type="number" id="WBottom" value="-0.01"></td>
<td>Top</td>
<td><input type="number" id="WTop" value="0.01"></td>
</tr>
<tr>
<td>Near</td>
<td><input type="number" id="WNear" value="0.01"></td>
<td>Far</td>
<td><input type="number" id="WFar" value="100"></td>
</tr>
</table>
<label class="config" for="LightsURL">Lights JSON URL</label>
<input class="config" type="text" id="LightsURL"
value="https://kunmiaoyang.github.io/MissileCommand/model/lights.json" style="width: 400px;"> -->
<!--load sounds-->
<audio id="sound_intro" loop controls>
<source src="sound/intro.mp3" type="audio/mp3">
</audio>
<audio id="sound_play" loop controls>
<source src="sound/play.mp3" type="audio/mp3">
</audio>
<audio id="sound_mission_complete" loop controls>
<source src="sound/mission_complete.mp3" type="audio/mp3">
</audio>
<audio id="sound_game_over" controls>
<source src="sound/game_over.mp3" type="audio/mp3">
</audio>
<audio id="sound_UFO" controls>
<source src="sound/UFO.mp3" type="audio/mp3">
</audio>
<audio id="sound_walking" loop controls>
<source src="sound/walking.mp3" type="audio/wav">
</audio>
<audio id="sound_collision" controls>
<source src="sound/ouch.mp3" type="audio/wav">
</audio>
<!--load scripts-->
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="gl-matrix-min.js"></script>
<script type="text/javascript" src="dom.js"></script>
<script type="text/javascript" src="option.js"></script>
<script type="text/javascript" src="url.js"></script>
<script type="text/javascript" src="frustum.js"></script>
<script type="text/javascript" src="lights.js"></script>
<script type="text/javascript" src="image.js"></script>
<script type="text/javascript" src="lod.js"></script>
<script type="text/javascript" src="vertexCluster.js"></script>
<script type="text/javascript" src="models.js"></script>
<script type="text/javascript" src="JSONModel.js"></script>
<script type="text/javascript" src="SkechupModel.js"></script>
<script type="text/javascript" src="sound.js"></script>
<script type="text/javascript" src="shader.js"></script>
<script type="text/javascript" src="events.js"></script>
<script type="text/javascript" src="camera.js"></script>
<script type="text/javascript" src="rooms.js"></script>
<script type="text/javascript" src="culling.js"></script>
<script type="text/javascript" src="rasterize.js"></script>
<script type="text/javascript" src="animation.js"></script>
</body>
</html>