Home » Uncategorized

Genetic Algorithms Part 1.

31 May 2005 No Comment

Today I got back to a topic which has long since confounded me, that is Genetic Algorithms, specifically where it applies to image creation.

Genetic Art is essentially evolved images, drawn using a tree of instructions. The tree starts life as a single random node, maybe a constant or a sin(x) or something. A population is created using a number of these single node trees. A fit function is executed to see which pictures are the most interesting/beautiful, in the case of images the nice thing is that a human makes a good fit function. Essentially removing the most difficult (and subjective) portion of the coding. A new population is created by varying the parent’s tree of instructions. Essentially mutating or varying parameters, adding new leafs to the tree etc.

genetic artEventually a solution is arrived at, in this case a picture that looks pleasing. The technique has wide applications and I’ve even seen it used by Natural Motion in their Endorphin product to train virtual stuntmen to walk. (checkout the demos on their site). Crazy.

So that’s what I’m working on, I’ve generated a couple of images, very boring but hopefully in the next few days I’ll get something downloadable up here. I cannot claim credit for this algorithm, it’s largely due to the work of Karl Sims(1991).

Above is Cos(y) * Sin(x) * Sqrt(x)
genetic artAnd here’s “Y – Sin(x)”

One goal might be to “grow” a 3D representation of a mathematical form. That’s version 2.0 and to be honest once the 2D version is perfected, should not be that difficult. In once sense, a 3D version would be very similar to a Metaball and you could probably use the same Marching Cubes algorithm to render it. At least to identify the drawable surface. Then texturing would complicate things but I’m thinking out loud. Time to end this blog.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.