Creating water ripples with Cellular Automata

Demo Video

Goal: Experiment with cellular automata code example to create cell objects and visualize cell history

For this sketch, I kept it simple so that I could understand how cellular automata works. I used Dan Shiffman’s code example as a foundation to explore. I am still thinking about the ocean from my last sketch and how to mimic all the intricacies of the water. Therefore, I was drawn to the CA algorithm and how the cells expand and disappear. First, I implemented a feature where new cells are activated at the current position of the cursor when you click the mouse. Then, I refactored the code example to create a Cell class and make new cell objects in each generation. Each cell object keeps track of the state and the cell’s history and uses the cell’s history to control the opacity of the cell. Each time a cell’s state changes, I add the new state to the history field for that object.

Here is the same sketch in black and white to observe the gradient more closely.

Sketch in black and white

Midway through this, I was curious about adding sound to the cells and playing different notes for different states. However, I realized there is a lot of overlapping issues since there are many circles with the same state at any given point. I am curious about exploring this idea further in the future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s