Рет қаралды 10,879
Playing around with gravity, anti-gravity, and elastic forces!
Start with this: playcode.io/666098
Finished Product: playcode.io/658580
If you haven't seen the pong video, check it out here:
• Let’s Build a Physics ...
Visit MinuteLabs.io for more interactives and simulations!
minutelabs.io
----
Donate
If you get something out of the work I do, consider sponsoring me on either:
Github Sponsors: github.com/sponsors/wellcaffe...
Patreon: / minutelabsio
----
Contents
00:00 Introduction
01:52 Making a higher DPI canvas
04:43 Creating a bunch of nodes
15:40 Min-Max Normalization with lerp()
21:57 Connecting the dots (nodes)
27:12 Distance dependency (the proximity part)
29:54 Fun stuff to try
31:00 Colouring the connections with rescale()
36:14 Minimum distance threshold
37:09 Smoother animation with requestAnimationFrame()
41:16 Faster line drawing
43:54 Adding forces
48:15 Elastic forces
49:50 Gravity
53:32 Parting thoughts
---
Music
"Land of the RetroOnes" by RAGE
"Local Forecast - Elevator Music" by Kevin Macleod