-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
49 lines (43 loc) · 1.91 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
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/style.css">
<title>Node Garden Effect</title>
</head>
<body>
<header>
<h2>Node Garden Effect</h2>
<details open>
<summary>About</summary>
<p>We basically just draw a line between two particles if they are within a certain distance from each
other.</p>
<p>Particles also have a simple spring acceleration towards one another, which can make for some complex looking
shapes.</p>
<p>This demo uses a uniform grid for space partitioning in order to do a faster neighbour lookup (basically collision detection) with a lot of objects.</p>
<p>A demo app for comparing the performance of the naive collision detection method against the grid based one can be seen
<a href="https://topaz1008.github.io/canvas-node-garden/gridtest.html" target="_blank">HERE</a>.</p>
</details>
<details>
<summary>Source Code</summary>
<p>Can be found on my <a href="https://github.com/topaz1008/canvas-node-garden/" target="_blank">GitHub</a>.
</p>
</details>
<details>
<summary>Credits</summary>
<p>The grid algorithm and basic idea is presented in <a
href="https://www.amazon.com/AdvancED-ActionScript-Animation-Friends-Learning/dp/1430216085"
target="_blank">AdvancED ActionScript Animation</a> by Keith Peters.</p>
</details>
</header>
<main id="main-container" class="">
<div id="canvas-container">
<canvas id="main-canvas"></canvas>
</div>
</main>
<script src="src/main.js" type="module"></script>
</body>
</html>