Particles made from pictures! In this video we make some particles that are repelled by the mouse and want to get back to their home location. The locations and colours of the particles are dictated by the image used to place them!
These particles are very versatile, you can play around with how strong the attraction/repulsion forces are, what they are repelled and attracted to, and even experiment with how you place them on the screen (maybe try using text or sound!).
If you have any questions be sure to ask in the comments down below :)
If you want to code along you can use the P5js online editor:
https://editor.p5js.org/
Find the code for this video here:
https://editor.p5js.org/BarneyCodes/sketches/k0ImyGuo9
Check out my website:
https://barneyw.net/
0:00 Intro
0:27 Particles class
3:26 Calculating forces
8:00 Applying forces
10:27 Oops, wrong direction!
11:19 Final particles
12:27 Loading an image
15:18 Placing particles with the image
20:22 Final product
21:14 Final final product!