-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (44 loc) · 948 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<style>
html,
body,
#polygonjs-app {
margin: 0px;
height: 100%;
overflow: hidden;
}
body {
background-color: gray;
}
canvas {
display: block;
height: 100%;
}
#controls {
position: absolute;
top: 10px;
left: 10px;
}
</style>
</head>
<body>
<div id='controls'>
<button onclick='scene.setFrame(0)'>Restart</button>
<button onclick='scene.pause()'>Pause</button>
<button onclick='scene.play()'>Play</button>
<label>Rigid Bodies Count</label>
<input type="range" min=50 max=1000 step=1 value=500 oninput="setRBDCount(event.target.value)"></input>
</div>
<div id="polygonjs-app"></div>
<script>
function setRBDCount(count){
scene.node('/physics/scatter1').p.pointsCount.set(count);
scene.setFrame(0)
}
</script>
</body>
</html>