Archives

Categories

Recursive tree-like patterns in Flash

On the Twelfth Day of Christmas my truelove said to me, “Take down the Christmas decorations!” So we did. Our Flash Christmas greeting has been replaced with something a little more experimental - a Flash application which draws a randomised tree-like pattern in response to a user-click. [Edit: The Flash application can now be found on the Labs page]

Whilst pondering what to post on our Home page once the festivities were over, I got to thinking about the Christmas tree element of the greeting. The tree comprised a sequence of simple timeline-based animations, which Dan created using the tweening tools built in to Flash. I thought it would be quite cool to have a tree that was generated programmatically, based on a few predetermined rules. I’ve been interested in Flash and generative art for a while, and this isn’t the first time I’ve thought about developing something to draw tree-like patterns, although I haven’t really followed it through until now.

Clicking anywhere on the canvas will “plant” a tree at the corresponding position. The trunk of the tree is a single branch, which self-generates additional branches as it approaches maturity. Each branch recursively calls the same code. As the number of branches increases, so does the number of calculations and screen updates required, and the Flash Player soon starts to labour under the load. In order to prevent the application from grinding to a halt, branches will only generate offshoots if their final length is above a certain threshold. I also set a limit to the number of generations permitted.

The parameters took a bit of tweaking to get something that didn’t look too dense, too spindly, too sparse or just plain freaky! On the whole I think the application does a pretty good job of rendering an organic-looking tree, despite the fact that it is all done with straight lines.

Oh, and here’s wishing you all a happy and prosperous New Year.

Leave a Reply

Why Do We have A Blog?

There are several very good reasons why we have incorporated a blog into our web site. It’s relatively simple to do after all.

  1. A blog is great tool for quickly adding new content to a web site. We chose WordPress, and its ease of use means we are more likely to keep updating the site on a regular basis, whenever one of us has ten minutes to spare.
  2. Visitors like fresh content. Keeping the site updated will encourage people to come back again and again. It all helps when building an online presence and winning customer mindshare.
  3. Search engines like fresh content too. As long as we keep it relevant it all counts towards ratings.
  4. We’re creative types, and blogging is form of self-expression. When we’ve got something to say it won’t do to bottle it up.
  5. We’re good at what we do, and blogging about it is way of proving it to the world.

It all makes sense doesn’t it. Perhaps you should have a blog on your web site. Don’t think about it for too long though - give us a call…

Home · Branding · Digital · Print · Blog · Case Studies · Labs · Contact · Site Map
Pick up the phone · t: +44 1482 662138 · e:  · All content © 2012 Art & Soul Communications Limited except where otherwise attributed.