I decided to try and make a simple L-System in processing today, it turned out not half bad. For those wondering what I am talking about, im sure our willing friend ‘google’ can be of help.
My system works by generating a point in space, then using a L-system generated pattern to apply one of 8 transformations to the point, the transformations are:
- move up/down
- move left/right
- move diagonally down left/right
- move diagonally up left/right
As the transformations are applied, new points are created, each new point is joined to the previous point by a bezier curve of a set length.
My L-system is currently based on the fibonacci set of numbers, in summary the program iterates through the fibonacci sequence, generating a pattern of numbers that lie somewhere between 0 and 8 (I choose 8 as i only defined 8 transformations) to a set level that i specified (the length of the pattern). A parser then works through each number in the pattern, applying the transformation and drawing the new point and line.
To make it a bit more interesting, I decided to apply 3 rotation matrices to each new point (90 degrees, 180 degrees, 270 degrees) that is created, this in essence is like splitting the screen in to 4 quadrants and drawing the point in its equivalent place in each quadrant space. This all worked well, but I was getting the same results every time.
Computers are brilliant at crunching through numbers and conducting repetitive tasks accurately and quickly, so i decided to make a few of the initial variables random. With a simple click of the mouse button my sketch is completey redraw with a new set of parameters.
The image above is one particular configuration that I liked. This image uses a pattern that is 175 characters long, it uses only 4 of the 8 transformations i defined and it only rotates across 3 sectors (0 degrees, 120 degrees and 240 degrees).
More of this to come no doubt.