CodingTrain / Suggestion-Box

A repo to track ideas for topics
571 stars 86 forks source link

Random Walk Fractal Tree #919

Open NukeReactor opened 6 years ago

NukeReactor commented 6 years ago

I had just finished watching your video on random walkers, and you started suggesting your ideas for what you can do with those, such as music compositions and various other things, but what about a fractal tree? I had also watched your fractal tree videos and wouldn't it be possible to create a random walk algorithm and based upon that make a fractal tree?

Example 1: The random numbers go from 0 - 3 and it's rounded with a floor(). 0 will draw a line, 1 will turn right, 2 will turn left.

Example 2: Like before it'll generate numbers with a floor() around it but this time it's 0 - 5. 0 will draw, 1 = turn right, 2 = turn left, but 3 saves the last position and 4 will load that position kind of like your L-System fractal tree. So if it generated 0, 3, 1, 0, 2, 4, 0, it would draw, save that position, turn right, draw again, then turn left, then go back to that previous position and draw another line, then continue from there.

I would love to see this done, and I would do it but I'm not a super experienced programmer like you. Thank you for your time.

icrman14 commented 6 years ago

look up diffusion limited aggregation. It uses a self avoiding walk to make a cluster. There are all sorts of clusters you can make from random walks; you just have change the rules on how the particles move and stick to the cluster.