« March 2007 | Main | May 2007 »

April 25, 2007

GLArt Final Project: Life Tower


Gosper Glider Gun. Click thumbnail for a larger screenshot (1024x1228)

The Life Tower is a 3D visualization of Conway's Game of Life. The current generation is drawn on top of the tower, and each successive generation is drawn underneath.

As the tower grows, it builds organic structures that are invisible in a conventional two-dimensional representation of Conway's Game of Life. This mapping of time to a spatial dimension mirrors the usual practice for representing one-dimensional cellular automata, in which successive generations are drawn in a two-dimensional field.

Download the source code (Requires LWJGL and Mark Napier's OpenGL demo code; standalone executables forthcoming). Once you have it running, press 'H' for usage instructions.

The Life Tower is a project for Mark Napier's GLArt class.

More screenshots after the jump.


R-Pentomino after eighty generations, using blue material. Click thumbnail for a larger screenshot (1024x1228)


Three pentadecathlons. Click thumbnail for a larger screenshot (1024x1228)

April 13, 2007

GLArt and Nature of Code: More Big Tower Screenshots

Here are some (more) screenshots from my Life Tower program. Click on any of the thumbnails below to see larger (up to 4096x3072) versions.


Pi pentomino after 127 generations


Gosper's Glider Gun


Random initial distribution

Audio Art: Sutartinės

Notes and links for my presentation today:

Oh, and here's a bunch of sutartinės MP3s (for a limited time only.)

April 07, 2007

Nature of Code: L-Systems and Text

My take on generative poetry with L-Systems (Perl with a web front-end). Works like a graphical L-System, except the "turtle" moves back and forth over a one-dimensional array of words (supplied by a source text of your choosing). Here's some example output (using Genesis 1 from the KJV):

In the heavens morning
In the heavens morning
the heavens and were
And morning were God

And morning were God
And morning were God
the were the called
and God called which

the were the called
the were the called
evening the second the
it called the were

and God called which
and God called which
it called the were
the which were the

April 04, 2007

Nature of Code: Proposal for Final Project

screenshot thumbnail

Here's my idea: an interactive environment/game for breeding flowers using genetic algorithms. "Genetic algorithm" is liberally interpreted here: the flowers' genotype is image data (32x32 pixels), and the genotype is expressed by displaying that data to the screen. Crossovers and mutations are performed as image filtering and manipulation. The flowers exist in on a virtual "island" whose properties determine how crossovers and mutations are performed.

This applet demonstrates how the flowers look, breed, and mutate (press 0-9 to increase the likelihood of the corresponding flower to produce offspring, then press the spacebar to create the next generation of flowers). Here's a mockup of what the virtual island looks like (click and drag to move around or press 'n' to generate new terrain; there aren't any flowers there yet).

Here's the basic ruleset:

  • Flowers must be watered, or else they'll die. (Their amount of thirst will be reflected by a slowdown in swaying and a droopy demeanor.)
  • There are a number of different types of water; the type of water determines what mutations the flower's genotype will undergo when it breeds with another flower. Possible mutations include:
    • hue/saturation/brightness
    • transparency (alpha channel)
    • vertical and horizontal mirroring
    • skew/stretch/scale/rotation
  • The probability that a particular flower will breed with another flower is determined by the proximity of the two flowers in question. The resulting child flower will appear next to one of the progenitor flowers (perhaps after a growth period?).
  • The island is composed of several types of terrain. The terrain type determines the crossover method for flowers in that terrain. Possible crossover methods include:
    • "spots" of one flower overlaid on top of the other
    • even blending
    • stripes
    • iteration over each pixel
  • Users can transplant flowers (in order to move them closer to desired breeding partners, or to a new terrain), or throw them out (in order to remove them from the gene pool).

The eventual goal I have in mind is to create an Animal Crossing-esque game in which points are awarded for growing flowers with particular characteristics; players could use these points to unlock new kinds of mutations or terrain, or to purchase custom flowers (e.g., a flower with Alan Alda's face on it). Each player would have his own garden, but could trade flower "seeds" online with friends. (Maybe the terrain types are not evenly distributed between players, so you have to send your seeds to a friend in order to get crossover types normally unavailable to you! A lot of possibilities here.)

My final project will be a "proof of concept" for this game/environment. I want to implement the basic ruleset in the list above in order to see if I can make it intuitive and interesting.

April 03, 2007

GLArt: Final Project Ideas

I'm going to work a bit more on my Life Tower project. Here are some things I'd like to improve, and features I'd like to implement:

  • Ability to edit the initial state of the simulation (i.e., the top layer); this would allow the user to input patterns that are known to be interesting and see the results in 3D.
  • More camera flexibility. Right now, you're only able to move the camera up and down along the length of the tower. It would be nice to be able to, say, view it from directly overhead or directly beneath.
  • A better sense of three dimensions: Right now, stills captured from the program (see here) look like a jumbled mess, owing to the fact that it's hard to distinguish cells in the foreground from cells in the background. This needs to be fixed (fog? lighting tricks? shadows? transparency?)
  • Bonus: An interface for changing the rules of the simulation, or just the ability to select among different rulesets (see list here)
  • I'd like to generate a few more of those big screenshots using non-random starting patterns.

GLArt: Big Screenshot

large tower thumbnail

This is a big ol' screenshot (2048x3072, ~1MB PNG) I took of my Life Tower program, using sample code from Mark Napier.

I need to get me one of those AMS tickets.