Proximity Graphs with Gravity | Let's Build a Physics Simulation

  Рет қаралды 10,879

MinuteLabs.io

MinuteLabs.io

Күн бұрын

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

Пікірлер: 22
@Minutelabsio
@Minutelabsio 3 жыл бұрын
As usual post the codeplay links to your creations in the comments! I'll try to answer questions as best I can. Let me know if I should do a live stream where I play around with some stuff that didn't make it into the video!
@GoldSkulltulaHunter
@GoldSkulltulaHunter 3 жыл бұрын
I'm really enjoying this series of videos! Keep'em coming, please! THAT SAID, it's really annoying how easily and instantaneously you can spot the errors in your code. I wish I had that superpower (as opposed to just sit down and cry for 3 hours until I find the missing semicolon or whatnot). :D
@Minutelabsio
@Minutelabsio 3 жыл бұрын
I've been doing this a long time :)... but there are still days like that. The best remedy is a walk and a refill of coffee.
@PolineChan
@PolineChan 3 жыл бұрын
is this done in one take? the way you walk through the project is so smooth.
@PolineChan
@PolineChan 3 жыл бұрын
i'd tune in to live stream if there's no conflict with my schedule. Adding particle collision would be cool
@Minutelabsio
@Minutelabsio 3 жыл бұрын
Thanks! It was two recording sessions. I do it all at once but smooth things out in the editing process
@user-cd4bx6uq1y
@user-cd4bx6uq1y 2 жыл бұрын
2 arrays, each "iteration" change a binary variable that's used in an if check and copy data modified based on other data from on other data and yeah. Then display all that.
@usama57926
@usama57926 3 жыл бұрын
*Love the tutorial please make more projects like this*
@chanokim
@chanokim 3 жыл бұрын
Just wanted to leave a comment that I love your video and it was hugely helpful to me. I appreciate it. I am looking forward to next episode for a few months now.
@Minutelabsio
@Minutelabsio 3 жыл бұрын
Glad you found it helpful!
@usama57926
@usama57926 3 жыл бұрын
*36:05** Its like quantum fluctuations in subatomic world*
@bengriffiths9631
@bengriffiths9631 3 жыл бұрын
How accurate do you think this is at simulating the many body problem? Also, I'm curious as to if you put relativistic effects in, could you simulate an event horizon beyond which nothing can escape?
@nayoneva8695
@nayoneva8695 3 жыл бұрын
U r video's just get better and better
@rusca8
@rusca8 3 жыл бұрын
How do you make the "contents" thing mark itself on the progress bar?
@rusca8
@rusca8 3 жыл бұрын
oh, the first time must be 0:00
@flamesdiamond
@flamesdiamond 2 жыл бұрын
47:00 nodes:ZOOM
@chanokim
@chanokim 3 жыл бұрын
Shouldn't we add/subtract velocity both to node1 and node2? Why add one and subtract the other?
@Minutelabsio
@Minutelabsio 3 жыл бұрын
It's because to calculate the force we use a displacement (node2.position - node1.position). This points from node1 to node2. If that arrow "pushes" node2, it'll push it away from node1. If we let it push node1 in the same way, it would push node1 towards node2 so they'd go in the same direction. That's why we reverse it for the other node by doing subtract() instead of add()
@joaquimmello6199
@joaquimmello6199 3 жыл бұрын
why banana has potacio always wanted to know
@Vixifusf-cy4rh
@Vixifusf-cy4rh 3 жыл бұрын
Vim pelo video do Minuto da terra BRASIL :)
@chuckinator0
@chuckinator0 3 жыл бұрын
I’ve used Processing.org to do simulations like this before (e.g. www.khanacademy.org/computing/computer-programming/programming-natural-simulations), but it looks like playcode.io is the real deal when it comes to JavaScript, css, and html5. Processing is nice, but to do these simulations in an environment that is broadly used across the industry is really cool
@61O_42
@61O_42 3 жыл бұрын
am I the second here?
Simulating Lifespan (Why do blobs die around age 2?)
9:33
MinuteLabs.io
Рет қаралды 158 М.
This lab took me 6 years to release
3:25
MinuteLabs.io
Рет қаралды 11 М.
Miracle Doctor Saves Blind Girl ❤️
00:59
Alan Chikin Chow
Рет қаралды 57 МЛН
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 126 МЛН
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 29 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 29 МЛН
Complex Behaviour from Simple Rules: 3 Simulations
10:52
Sebastian Lague
Рет қаралды 373 М.
Were Humans Destined to Exist?
5:30
SciShow
Рет қаралды 47 М.
But How DO Fluid Simulations Work?
15:12
Gonkee
Рет қаралды 364 М.
Swarm intelligence simulation.  Project "Screaming Insects"
13:43
Simulife Hub
Рет қаралды 110 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 4,9 МЛН
Is coding important when studying physics?
7:17
Tibees
Рет қаралды 487 М.
Painting a Landscape with Maths
42:00
Inigo Quilez
Рет қаралды 694 М.
Let’s Build a Physics Simulation (PONG: Part 1)
41:27
MinuteLabs.io
Рет қаралды 10 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 502 М.
Топ-3 суперкрутых ПК из CompShop
1:00
CompShop Shorts
Рет қаралды 455 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,6 МЛН
Цифровые песочные часы с AliExpress
0:45
Задача APPLE сделать iPHONE НЕРЕМОНТОПРИГОДНЫМ
0:57
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 10 МЛН