-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
109 lines (90 loc) · 3.91 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="web/css/style.css">
<title>Demo</title>
</head>
<body>
<canvas class="canvas"></canvas>
<canvas class="canvas"></canvas>
<dialog open id="dialog" class="center-message box">
<pre style="text-align: center;" class="row">Allow parallel execution? <i>(experimental)</i></pre>
<div class="hor-options row">
<span class="label option" onclick="loadParallelLibVersion();">Yes</span>
<span class="label option" onclick="loadSeqLibVersion();">No</span>
</div>
</dialog>
<div class="box center-message" id="menu">
<pre class="row"><b>Left click on canvas</b> - start movement
<b>wasd</b> - move around
<b>qe</b> - roll left / right
<b>Space</b> / <b>Shift</b> - move up / down
<b>Left Click</b> - cast a ray
<b>Mouse scroll</b> - change speed
<b>Enter</b> - take screenshot</pre>
<div class="row option" style="display: flex;">
<input id="threads-count" disabled type="range" min="1" max="8" step="1" value="1" oninput="this.nextElementSibling.value = this.value + ' thread(-s)'"/>
<output>1 thread(-s)</output>
</div>
<div class="row selector-box">
Splitter
<div class="hor-options">
<span class="option">
<input id="sah-option" type="radio" name="splitter" checked value="sah" onclick="updateTree()"/>
<label for="sah-option" class="label">SAH</label>
</span>
<span class="option">
<input id="median-option" type="radio" name="splitter" value="median" onclick="updateTree()"/>
<label for="median-option" class="label">Median</label>
</span>
</div>
</div>
<div class="row option">
<input id="traversal-checkbox" type="checkbox"/>
<label for="traversal-checkbox" class="label">Visualize traversal <small>(<b>Arrow Up</b> to traverse)</small></label>
</div>
<label for="file-upload" class="row upload-button">
<input type="file" id="file-upload" accept=".stl,.obj,.ply"/>
<span class="file-upload-text">Upload 📁 <i>(<= 512MB) (stl, obj, ply)</i></span>
</label>
<div class="row label option" onclick="location.reload();">Back</div>
</div>
<script id="shader-vs" type="x-shader/x-vertex">
#version 300 es
in vec4 a_position;
in vec2 a_texcoord;
uniform mat4 u_projection;
uniform mat4 u_view;
out vec2 v_texcoord;
void main(void) {
gl_Position = u_projection * u_view * a_position;
gl_PointSize = 10.0;
v_texcoord = a_texcoord;
}
</script>
<script id="shader-fs" type="x-shader/x-fragment">
#version 300 es
precision highp float;
in vec2 v_texcoord;
uniform sampler2D u_texture;
uniform vec4 u_colorMult;
out vec4 outColor;
void main(void) {
vec4 color = texture(u_texture, v_texcoord);
if (color.a == 0.0) {
discard;
} else {
outColor = color * u_colorMult;
}
}
</script>
<script src="web/js/twgl-full.min.js"></script>
<script src="web/js/drawable.js"></script>
<script src="web/js/camera.js"></script>
<script src="web/js/intersection_handler.js"></script>
<script src="web/js/mesh.js"></script>
<script src="web/js/tree.js"></script>
<script src="web/js/viewer.js"></script>
</body>
</html>