Wednesday, April 11, 2007

Papervision Ase: the source!

Of course: papervision. I could not stay behind.

I was playing around a bit with it and then I saw the possibility to render .ase files. This are files from 3D studio max. I got an ase-file from a colleague and I started working. I had to build a few workarounds because the objects that are created from the ase-files are no movie clips and I wanted to give them events like a rollOver.

You can see the result here (this can take some time because the ase files need to be parsed first).


Here is the code: Bacterie3D.as


Tuesday, March 20, 2007

L-Systems

One of my colleagues was so kind to give me this book on L-Systems: The algorithmic beauty of plants by Przemyslaw Prusinkiewicz and Aristid Lindenmayer.
I was interested in what you could do with it and I asked google. I found this site where a few classes were shared that I could use. Drawing with L-Systems uses a formula to describe a path. Different symbols make the pen do different actions like draw, turn or change color. A function can be composed of different other functions so we can make very difficult drawings.
The concept of iterations is very clear with the 'Sierpinski gasket'-example. It draws a triangle upside down inside the base triangle and with this creates 3 new ones. Depending on how many iterations you want, a new triangle is drawn in these 3 new triangles, creating again 3 new triangles for these 3 new triangles. And so on and on.
I tried some of the formulas from the book and it worked fine. I changed the code a little bit so it is now possible to change the amount of iterations and have a better idea of what is actually going on.

(Some of the examples are very processor intensive if you take more iterations. My advise is to add just 1 iteration every time. The drawing also becomes to big for the small screen if you make a lot of iterations.)





L-systems are much more than what I show here. Now we change directions and angles of the pen, but we can also change colors and add a 3rd dimension.
















Well... we have to start somewhere.

For those who are interested: the source. Special thanks to Mitch Allen.