About Me

Tobias
A 30+ year old Msc. Graduate in Computing Science currently working in the financial technology sector.
View my complete profile
Tuesday, June 15, 2010

The Computational Beauty of Nature


A
nother good reading that I recommend is "The Computational Beauty of Nature" by Gary William Flake.


A very illustrative book which covers the most fundamental parts of emergent behaivor. Not at all as heavy as A New Kind of Science, with consideration to the body and mind.

- Tobias

A New Kind of Science


F
or some heavy reading, and I mean both physically and psychologically I recommend "A New Kind of Science" by Stephen Wolfram, the founder of Mathematica and a driving force behind Cellular Automata.

This thing consists of 1197 pages(!) and is not something you want to fall asleep under when laying in bed. However, the chanses of that are slim when you most likely won't be able to hold it for a longer period of time(yes, it's heavy).

- Tobias

Fractals


F
irst of all, fractals are a bloody huge area which we are going to come back to several times, but for now I will settle with a brief introduction. The short description is - A fractal is natures answer to lego. Well, not quite but to some extent.

A fractal is a rough or fragmented geometric shape that can be split into parts, each of which is (at least approximately) a reduced-size copy of the whole, a property called self-similarity.
This is a fairly fitting description, but I will try to level it out even more. Note that I do not intend that readers must have a M.Sc degree in physics, mathematics or computing science to understand what I'm talking about. This blog is for everyone with an interest nomatter background. I may at times digg deeper in certain areas, applying theories with programming which WILL be hard to understand if you lack certain knowledge. But, I will do my best explaining it in simpler form.

So, back to fractals. They can take many forms and shapes, litteraly and the applicible areas are numerous. But as I said from the begining fractals can roughly be described as natures lego. By applying fractal design you can generate objects taken from real life and the varity is huge. From mountains and landscapes down to trees, bushed and plants. Fractals, when combined produce patterns and the most famous must be the Mandelbrot Set displayed to the left in the picture below.

Notice the pattern, you see it? Now look att the second picture to the right. Do you see it? Same pattern and doesn't that remind you of a snowflake? I'm not going into the mandelbrot fractal further, it's to complex for me to describe on this blog and there are several mathematical aspects of it so I'm just going to leave it up to you.

Moving on - life will find a way. Or God found a way, the lazy bastard , to generate land, mountains, trees and plants using "only" one key element. Building fractal mountains is fairly simple and a quick way of illustrating this is done in here. The site contains code for all you programmers out there, and at the end of the article the owner has posted links and compiled code for you none-programmers.

Download the Win32 binary, unzip it and execute the exe file and play around to get an idea how fractal mountains are generated. The more iterations you make, the more detailed mountains you get. If you were to add texture to this model you would get something like the picture to the right. Of course this mountain has been generate in a more complex way, but the same theory is applied.

If we take it down a notch or two, we get trees and plants. If generating mountains and landscapes were fun, this will surely twist your eyes.

To the left we have beautiful corals and to the right every kids favorite - Broccoli. See the twists and re-appearing patterns, fractals in its most exquisite form.

- Tobias
Monday, June 14, 2010

Boids


The most famous technique, if there is one, must be Craig Reynolds "Boids". Developed in 1986 Craig Reynolds made a computer model of coordinated animal motion such as bird flocks and fish schools. Speaking for myself, this model is the foundation of emergent behaivor ... it was this model that got me interested, and got me thinking in other directions. It's quite simple really, but the result is far more complex ...

(from the left)
Alignment: steer towards the average heading of local flockmates
Cohesion: steer to move toward the average position of local flockmates
Separation: steer to avoid crowding local flockmates

I told you, simple ... but look at the result when the rules interact with eachother.







Calculations between birds(boids - agents in the simulation) are made in realtime. The result is quite amazing. Hence, the clip above also have an extra rule which can be called Avoidance - Stay clear of a specifik object. As you now may have realized - yes, you can add more rules to the simulation. Giving each agent a new behaivor which combined with the existing rules may result in something completely unexpected. That's the tricky thing with emergent systems, simple alterations may have a bigger impact in the full aspect than one may come to expect.

This technique has come to be VERY popular in games and movies, we have all seen the Lord of the Ring trilogy where it's adapted in several scenes. But not just new films, remember "The Lion King" from 1994 where Simba is chased in the ravin by herd av gnus?

I'm going to leave the subject for now and stay clear of the hard core tech parts, but I will return to it later. Don't forget to visit Craig Reynolds to take part of his work in the area. Did I mention that he nowdays work at Sony Entertainment, I wonder why =)

-Tobias