Home   About   Contact   Log in

Context Free - Computer Generated Art

July 12th, 2008 | Filed under Projects.

I’ve rediscovered the programmer friendly art ‘package’ known as Context Free, a system that allows pretty and often fractal images to be created from things known as context free grammars. I had a go with this before, but couldn’t quite work out what was going on. This time though, things make more sense.

After a few random pictures, I managed to create the image you see above.

It’s done using surprisingly few lines of code, the magic being in the recursive nature of both the pattern and the code generating it:

startshape trunk

rule trunk {
SQUARE {y 0.2 s 0.1 1}
fork{}
}

rule fork {
branch {y 1 x -0.33 r 45}
branch {y 1 x 0.33 r -45}
}

rule branch {
fork {s 0.7}
SQUARE {s 0.1 1}
}

I’m going to have a bit of a play with this and see what I can come up with.

Visit my other sites: Photo Gallery | Insane in the Membrane | Main website
Rate this:
0.0

Tags: , , ,

Share Your Thoughts

Photoblogs