L-systems in Flex
I’ve made a small application in Flex to draw l-systems with.
The previous post explains what l-systems are exactly, but here are the rules again in short:
L-systems is a grammar describing the growth of plant-like structures. It is made up of simple drawing commands and rules how these change during growth. For example, you start out with the command ‘F’ meaning draw one unit. You add a rule that says ‘change F to F+F-F’ where ‘+’ and ‘-’ mean turn left and right, respectively, with a predefined angle. Then, as it grows, the sequence of commands grows longer and more complex, as every time each ‘F’ is replaced by ‘F+F-F’ until you end up with a long sequence of simple commands that make up a complex shape. Add branching with the ‘[’ (start branch) and ‘]’ (end branch) characters and you can quickly create nice plant structures.
Try out the application here. It’s a small first version with some limitations, such as a maximum amount of drawing commands to prevent slow processing times, the possibility to define only one rule, and the fact that it always starts out with ‘F’. You can define your own rule of how ‘F’ changes (using F, +, -, [ and ]), you can set the angle of rotation and the amount of iterations to define the complexity of the resulting shape. If responses are too slow, you can turn off ‘update realtime’ and hit the ‘go’ button to calculate your l-system.
July 11th, 2007 at 2:58 pm
Ralph is koning