danomatika’s portfolio

LIFE!

I built a simple John Conway’s Game of Life simulator as an OpenGL exercise.

October, 2005

Cellular automata are mathematical models where a grid of individual cells react with their neighbors based on a series of simple rules. Each cell has a specific state, usually represented by color.The most well-known cellular automaton is mathematician John Conway’s Game of Life where cells in a 2 dimensional grid hold one of 2 states: “alive” or “dead”. The state of each cell is based on the states of the 8 neighbors by a simple set of rules:

  • a live cell dies if:
    – it is lonely: fewer then 2 neighbors are alive
    – it is overcrowded: 4 or more neighbors are alive
  • a live cell lives if 2 or 3 neighbors are alive
  • a dead cell comes to life when 3 neighbors are alive

From such a simple framework comes an almost biological process where different structures move about and interact until the whole system reaches equilibrium – only unmoving or oscillating structures are left. There is a whole science based on using cellular automata to represent numerous natural systems.

I built this implementation as an exercise in OpenGL. It is a rather simple framework, but provides a large amount of interesting visual interaction.

It’s built in C++ using OpenGL and freeglut.

———————————————————————-

Watch my program running.

life

———————————————————————-

The pics are of grids 50×50, 5×50, and 50×5.

(I especially like the visual aesthetic of the elongated pixels)


Leave a Reply