Coding Challenge #34: Diffusion-Limited Aggregation

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=Cl_Gjj80gPE



Duration: 47:07
98,516 views
1,613


In this coding challenge, I explore the generative algorithm "Diffusion-Limited Aggregation". The pattern is generated from random walkers clustering around a seed (or set of seed) point(s). Code: https://thecodingtrain.com/challenges/34-diffusion-limited-aggregation

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/XpS9wGkbB

πŸŽ₯ Previous video: https://youtu.be/flQgnCUxHlw?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Next video: https://youtu.be/BAejnwN4Ccw?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
πŸ’Ύ Atom Live Server Package: https://atom.io/packages/atom-live-server
πŸ”— Diffusion-Limited Aggregation on Wikipedia: https://en.wikipedia.org/wiki/Diffusion-limited_aggregation
πŸ“š DLA reference: http://paulbourke.net/fractals/dla/

Related Coding Challenges:
πŸš‚ #15 Object-Oriented Fractal Trees: https://youtu.be/fcdNSZ9IzJM
πŸš‚ #52 Random Walker: https://youtu.be/l__fEY1xanY
πŸš‚ #127 Brownian Tree Snowflake: https://youtu.be/XUA8UREROYE

Timestamps:
0:00 Welcome to another Coding Challenge
1:10 The DFA algorithm
3:36 Create a tree array
4:30 Create a random walker
8:44 Release mulitple walkers at a time
10:11 Create a Walker object
12:39 Create an array of walkers
13:14 Use optional arguments to initialize x and y
15:30 Display the objects in the tree and walker arrays
17:12 Push a walker to the tree array when it gets "stuck"
19:18 Change the color of the walkers that are stuck
19:47 Move the walkers multiple times per frame
21:37 Eliminate the square root calculation to improve the rendering speed
26:17 Add a random point along the edges
28:34 Add fewer walkers with a large number of iterations
29:15 Try different patterns
32:39 Different creative possibilities
36:00 Let each walker have its own radius
41:45 Shrink the radius for each new walker
43:30 Add a terminal condition
44:06 Map the hue to the radius of each walker
45:13 Thanks for watching!
46:08 Bonus addendum: improvements to code

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

πŸš‚ Website: http://thecodingtrain.com/
πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://discord.gg/hPuGy2g
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#paulbourke #diffusionlimitedaggregation #p5js #javascript







Tags:
challenge
coding
diffusion
limited
p5.js
daniel shiffman
p5js
creative coding
p5.js tutorial
nature of code
algorithm
coding challenge
programming challenge
js
Paul Bourke
Diffusion-Limited Aggregation
Diffusion-Limited
javascript diffusion-limited aggregation
code DLA
DLA algorithm