-
Notifications
You must be signed in to change notification settings - Fork 1
/
white_wall.html
33 lines (32 loc) · 1.19 KB
/
white_wall.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
<!DOCTYPE html>
<html>
<head>
<title>Global Illmuniation in 2D Example</title>
<script src="gi2d.js"></script>
</head>
<body>
<div>
<canvas id="gi2d_canvas" width="1024" height="768"></canvas>
</div>
<div>
<button onclick="refresh();">Refresh</button>
# Samples: <input type="number" value="32" id="inputNumSamples"></input>
# Hemispherical Samples: <input type="number" value="128" id="inputNumHemiSamples"></input>
</div>
<script type="text/javascript">
gi2d = new GI2D(document.getElementById("gi2d_canvas"));
var wall1 = gi2d.addWall(new Wall(new Line([0, 0], [1, 0]), 10.0, 0.0));
var wall2 = gi2d.addWall(new Wall(new Line([1, 1], [0, 1]), 0.0, 0.0));
var wall3 = gi2d.addWall(new Wall(new Line([0, 0], [0, 1]), 0.0, 1.0));
function refresh() {
gi2d.drawScene();
var num_samples = document.getElementById('inputNumSamples').value;
var num_hemi_samples = document.getElementById('inputNumHemiSamples').value;
gi2d.setNumHemiRays(num_hemi_samples);
gi2d.drawIrradianceOnWall(wall2, num_samples, 100.0);
gi2d.drawLegend();
}
refresh();
</script>
</body>
</html>