"To understand recursion, you must understand recursion."
(How I love this.)
I made one of my little generative art animations with the idea of seeing what kind of effect I could get from recursively drawing some simple shape or shapes over and over again with small changes.
I used just a box and a circle and came up with this:
function makeBox(x,y,s)In this case the function makeBox calls itself within it's own definition. This can be very powerful. And so much fun!
{
translate(x,y);
rotate(s/10+(col/2)%360);
blah, blah, blah
{
makeBox(x+s/4, y, s/2);
makeBox(x-s/4, y, s/2);
makeBox(x, y+s/4, s/2);
}
}
I hope you enjoy.