Turing Pattern Generator

Turing Pattern Generator

A while back, I was looking for a quick way to generate some Turing reaction-diffusion patterns.  You know, as a way to pass a lazy Saturday afternoon.

What I came a across was Cyclic Symmetric Multi-Scale Turing Patterns by Jonathan McCabe, and a number of links to implementations of some of his algorithms.  One of these implementations was done in Processing, which is a language-and-environment designed for quickly prototyping ideas, and making graphics programming very accessible.  (It’s accessible enough that it’s the starting point for the Arduino programming environment.)

Turing reaction-diffusion systems work by mixing two “ingredients”, which then flow into different concentrations.  Along the edges of each “ingredient” in the mixture, they react with the opposite ingredient.  Within their own areas of concentration, they diffuse into smooth shapes.  React and diffuse — hence the name.

Alan Turing did this math by hand, and not living long enough to see his math verified by computer simulators.

I modified the Processing implementation to output both the ingredient mixture image (the top half), but also the diffusion state image (the bottom half), which is a sort of velocity graph of the mixture ingredients.  This comes in useful later.  By combining the two in Maya, and using the top half as input to a color ramp and the bottom half as a bump map, I get the nifty green image below.


I then modified the Processing implementation further to generate a 3-d turing pattern.  Through some more scripting, I built this up in Maya as well, but the results are difficult to visualize in a compelling result.




A zipped up copy of my Processing project code to generate the 2d reaction-diffusion image.




Leave a reply