inconvergent has a great article about generative art, with many excellent examples of various techniques. While reading the section about Hyphae , I decided to give it a try and see what I could come up with along those lines. Hyphae (the plural of hypha) are long tendrils that grow from fungi. They grow from their tips, and will often branch new tendrils. My goal was to come up with a system to simulate their growth by following these rules:
While working on another project (stay tuned!), I came up with this. It’s not what I was shooting for, but I think it’s kind of interesting. It looks a bit like a city street map from a time before urban planning. What is going on here is that a single particle is placed on the canvas in a particular position and with a particular direction. At every iteration, the particle moves a small amount in its given direction. There is some random variation in the exact direction, but it ends up leaving a straight line, albeit a slightly wobbly one. Also at every iteration, there is a change that a new particle will be spawned and will branch off in a new direction, roughly 90 degrees from the previous particle’s path. A particles “dies” if its next position would leave the canvas or cross another line.
In my previous post , we came up with a program to generate a single 8-armed component of the aah tangle. In this post, we’ll figure out how to spread them randomly around the canvas, as in the image at the top of the post. We’ll use the program from the last post as a starting point. As a first try, let’s just generate a draw 20 aah images randomly on the canvas. Our draw() function looks like this: