-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboids.html
42 lines (42 loc) · 1.09 KB
/
boids.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Boids Simulation</title>
<style>
canvas {
display: block;
margin: 0 auto;
background: #000;
}
#controls {
display: flex;
justify-content: center;
margin: 10px auto;
gap: 10px;
}
input[type=range] {
width: 150px;
}
</style>
</head>
<body>
<div id="controls">
<label>
Time Step
<input id="timeStepControl" type="range" min="0" max="5" step="0.1" value="0.1">
</label>
<label>
Cohesion
<input id="cohesionControl" type="range" min="0" max="5" step="0.1" value="1">
</label>
<label>
Separation
<input id="separationControl" type="range" min="0" max="5" step="0.1" value="2.5">
</label>
</div>
<canvas id="boidsCanvas"></canvas>
<script src="boids.js"></script>
</body>
</html>