I initially thought of the concept for One Root after our lesson on L-systems. I loved the complex aesthetic that resulted from what amounted to be a very simple set of rules. In thinking about the different possibilities for how to visualize these systems, I thought about how it could be possible to evoke different imagery from slightly modified code. For instance, the classic l-system, with it's linear collections, resemble trees. I thought about what it would look like if I were to replace that linear representation with curves instead, or point clouds, or time-based particle systems.
After presenting my concept, I decided to focus on the most visually interesting of those options, the curves. My first challenge was after discovering that the type of curve I had originally pitched (a bezier) produced a far more unpredictable and harder to control aesthetic. I wanted a type of curve wherein I could place control points and know the basics of what the curve would look like. Catmull-Rom splines were readily available in the processing API, but the look was not quite right. The first and last points were used as control points and were not drawn to, leaving my curves shorter than what I was picturing. It took a bit of trial and error, but I found that by repeating the first and last points, they could be end-points and the curve could originate and finish there.
My next challenge was instantiating the system I had pseudo-coded. There were some basic rules I wanted my spiral system to follow.
- Every branch has either 1 or 2 children. One that follows the existing course, and the second to be an offshoot.
- The chance of a branch having an offshoot should reduce further along the system.
- An offshoot should have a chance of going left or right from its root
- A branch can go left or right, but once it starts a spiral, it should continue spiraling
- Since we don't want a line to go on indefinitely, the chance to spiral should increase further down the line
- A branch should reduce in size as it progresses
- In order to draw the system, a branch must know it's parent's location
I got started making this system and applied those rules to the parent, and not yet to the offset. The result was not what I was expecting.
It turned out that I had never set the initial direction of the system, so when I set the x rotation to be 45*direction, I was rotating 0. Duh. After fixing that issue, I had much more satisfying results.
I recognized early on that having every branch draw back 4 previous was not only inefficient, it wasn't clean or pretty. The curves weren't smooth, and there were too many overlapping lines.
So I set the draw function to instead draw only from the leaves and to draw all the way back. This cut down on the overlapping lines, but not entirely. It was really exciting to see how one equation could produce such different results!
Interesting phenomena could also be produced by changing the angle at which children turned. Here is a system using 90 degree turns.
I finally ended up correcting the overlap problem when I realized that offsets should only draw back to where they originated, rather than back all the way to the root. By modifying the way previous points were stored on offshoots, I got some much better results.
After that was fixed, I decided to start instantiating another draw system. Setting the mode to linear was very easy after having done curves, so I also threw in the ability to toggle weight.
These two are the same system in curvilinear and weighted linear modes.
And here's a gif of the system in action!
The way I see this being exhibited, given infinite time and resources, is as a large electronic display wall (8'x8', so probably projection as I don't imagine getting enough screens for that) divided into a 16x16 grid displaying one of these gifs each. To the side of this wall, close enough to be associated but far enough away to not obstruct the view, would be a tablet with this applet loaded onto it. A user could design a system (hitting restart as necessary) then when they decide they like the result, the press a button and presto! There it is on the screen, playing start to finish, looping indefinitely. I think it would be beautiful to watch these spirals coalescing around one another, all related, but all different.
For future advancements, I would like to try putting in the fudge factors I talked about in order to create different types of systems. For instance, the rules to modify this system to create lightning would be to increase the chance to create offshoots, to remove the check that continues spirals, and to turn the system upside down. Perhaps if I have some time later in the semester I could add that in.
If you would like to play with the generator on your own computer, below is a link to download the processing sketch. It doesn't use any special libraries, so you should be able to just plug and play. The code is well documented, so you are welcome to modify some of the variables to see what kinds of variations you can produce!
