Basic Fractal Tree
Another obsolete experiment! Click on the image to view it (view source enabled).
The concept is simple: alternate squares and triangles to produce a fractal tree-like structure. On each step, either triangles or squares are drawn in the edges of the last set of drawn elements. If the last set was triangles, squares are drawn and vice versa. Two squares can sprout from a triangle and a single triangle can sprout from a square, hence, triangles are the cause for bifurcations. That's it! Pretty simple, yet beautiful; the simple rules produce some very complex variations. I hope it is inspiring to produce more complex fractal beings.
Play around with the parameters:
[growthRate: Time in ms between the creation of each step] [maxSteps: The number of recursive iterations. Be careful not to go above 25! It could crash your browser] [Triangle base factor: From 0 to 1, controls the inclination of the triangles. 0.5 makes the tip of the triangle be above the mid point of the base] [Triangle height factor: Relationship of the height of tris to their base] [Square height factor: Relationship of the height of squares to their base].

October 5th, 2009 - 07:59
Fractals are always win. However, I think in 3D you’ve gotta do it 3D :p I want to do real-time animation of this at some point…
October 5th, 2009 - 08:04
Sure, that’s the next step. The concept in the demo is actually 100% 2D and 3D is there just as a ‘decorative’ element. 3D is in my mind though, just still thinking how exactly it would be cool to investigate it. Ideas welcome.
October 8th, 2009 - 22:24
I changed maxSteps to 180 and it crashed Firefox.
Cool app though!
October 8th, 2009 - 22:45
I did warn you!
I think that the triangle count should be around 2*2^(maxSteps/2), which for 180 would produce
2,475,880,078,570,760,000,000,000,000 triangles…
October 9th, 2009 - 04:58
…which is why you should have used minimum area threshold instead of fixed iteration count