Coding Challenge #34: Diffusion-Limited Aggregation
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
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Coding Challenge #34: Diffusion-Limited Aggregation», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.