-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (69 loc) · 2.3 KB
/
index.html
File metadata and controls
69 lines (69 loc) · 2.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<link rel="shortcut icon" href="#">
<style>
body {
background-color: rgb(150, 150, 150);
font-family: Arial, Helvetica, sans-serif;
}
#config {
position: absolute;
left: 5px;
top: 5px;
background-color: #001d62bd;
color: white;
border-style: solid;
border-color: black;
border-width: 2px;
text-align: center;
border-radius: 25px;
}
#canvas {
width: 800px;
height: 600px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
overflow: auto;
background-color: white;
}
</style>
<body>
<script src="utils.js" type="text/javascript"></script>
<script src="raytracer.js" type="module"></script>
<canvas id="canvas"></canvas>
<div id="config">
<table>
<tr>
<td>Max depth</td>
<td><input id="maxDepth" type="range" min="1" max="5" step="1" value="1" oninput="window.updateMaxDepth()"></td>
</tr>
<tr>
<td><label for="ambient">Ambient</label></td>
<td><input type="checkbox" id="ambient" name="ambient" onchange="window.toggleAmbient(this)" checked></td>
</tr>
<tr>
<td><label for="diffuse">Diffuse</label></td>
<td><input type="checkbox" id="diffuse" name="diffuse" onchange="window.toggleDiffuse(this)" checked></td>
</tr>
<tr>
<td><label for="specular">Specular</label></td>
<td><input type="checkbox" id="specular" name="specular" onchange="window.toggleSpecular(this)" checked></td>
</tr>
<tr>
<td><label for="reflection">Reflection</label></td>
<td><input type="checkbox" id="reflection" name="reflection" onchange="window.toggleReflection(this)" checked></td>
</tr>
<tr>
<td>Scene</td>
<td><input type="file" id="scene" accept="application/json" onchange="window.handleFile(this)" checked></td>
</tr>
</table>
<button onclick="window.renderScene(this)">Render scene</button>
</div>
</body>
</html>