-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
177 lines (173 loc) · 6.68 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flocking</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="libraries/p5.min.js"></script>
<script src="libraries/p5.sound.min.js"></script>
<script src="libraries/CCapture.all.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<p class="text-justify text-secondary">
<strong>Note: </strong> For best experience, please view this in a larger screen, i.e., desktop or a tablet.
Although it is responsive, because of the interactive elements it becomes uneasy to use.
</p>
<h2>Interactive Flocking Simulation</h2>
<div class="row">
<div class="col-xl-9">
<div class="container">
<div id="sketch-holder">
<!-- Main Sketch -->
<script src="sketch.js"></script>
<!-- Other Scripts -->
<script src="boid.js"></script>
<script src="quadTree.js"></script>
<script src="ui.js"></script>
</div>
</div>
</div>
<div class="col-xl-3">
<div class="text-justify">
<h3>Controls</h3>
</div>
<div id="check-box-holder" class="p-1">
<input type="checkbox" id="enableQtree" name="enableQtree" value="Optimize" checked></input>
<label for="enableQtree">Optimize</label><br>
<input type="checkbox" id="showQtree" name="showQtree" value="showQtree"></input>
<label for="showQtree">ShowQtree</label><br>
<input type="checkbox" id="showPercept" name="showPrecept" value="showPrecept"></input>
<label for="enableQtree">ShowPrecept</label>
</div>
<hr>
<div id="control-holder">
<div id="radio-holder" class="p-1">
<h6>Boundary Type</h6>
<input type="radio" id="bound" value="Bound" name="boundaryType"/>
<label for="boundaryType" class="border-right p-2">Bound</label>
<input
type="radio"
id="unbound"
value="Unbound"
name="boundaryType"
checked="true"
/>
<label for="boundaryType" >Unbound</label><br />
</div>
<div id="qtree-radio-holder">
<h6>Qtree Capacity</h6>
<input
type="radio"
id="coarse"
value="16"
name="qtreeCapacity"
checked="true"
/>
<label for="qtreeCapacity" class="border-right p-2">Coarse</label>
<input type="radio" id="medium" value="8" name="qtreeCapacity"/>
<label for="qtreeCapacity" class="border-right p-2">Medium</label>
<input type="radio" id="fine" value="2" name="qtreeCapacity" />
<label for="qtreeCapacity">Fine</label><br />
</div>
<hr>
<div id="slider-container">
<h6>Boid Parameters</h6>
<label for="numBoids" class="form-label">Number of Boids</label><br>
<input
type="range"
class="form-range"
min="0"
max="1000"
value="100"
step="25"
id="numBoids"
name="numBoids"
oninput="this.nextElementSibling.value = this.value"
/><output class="pl-4" id="numBoids">100</output><br>
<label for="alignSlider" class="form-label">Align Slider</label><br>
<input
type="range"
class="form-range"
min="0"
max="2"
value="1"
step="0.1"
id="alignSlider"
name="alignSlider"
oninput="this.nextElementSibling.value = this.value"
/><output class="pl-4" id="alignSlider">1</output><br>
<label for="cohesionSlider" class="form-label">Cohesion Slider</label><br>
<input
type="range"
class="form-range"
min="0"
max="2"
value="1"
step="0.1"
id="cohesionSlider"
name="cohesionSlider"
oninput="this.nextElementSibling.value = this.value"
/><output class="pl-4" id="cohesionSlider">1</output><br>
<label for="separationSlider" class="form-label"
>Separation Slider</label
><br>
<input
type="range"
class="form-range"
min="0"
max="2"
value="1"
step="0.1"
id="separationSlider"
name="separationSlider"
oninput="this.nextElementSibling.value = this.value"
/><output class="pl-4" id="separationSlider">1</output><br>
<label for="perceptionRadius" class="form-label"
>Perception Radius</label
><br>
<input
type="range"
class="form-range"
min="0"
max="200"
value="50"
step="5"
id="perceptionRadius"
name="perceptionRadius"
oninput="this.nextElementSibling.value = this.value"
/><output class="pl-4" id="perceptionRadius">50</output>
</div>
<div class="text-justify">
<hr>
<div id="button-container">
<button type="button" class="btn btn-primary btn-sm" id="toggleLoop">
Play / Pause
</button>
<button type="button" class="btn btn-secondary btn-sm" id="record">
Record
</button>
<p></p>
<a href="https://github.com/vharivinay/flocking-quadtree" target="_blank">
<button type="button" class="btn btn-info btn-sm">
Source Code
</button>
</a>
<a href="https://vharivinay.github.io/simulations/flocking/" target="_blank">
<button type="button" class="btn btn-info btn-sm">
Blog Post
</button>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>