Close

It's alive! It's alive!

A project log for Multi-scale Turing pattern generator

A multi-scale Turing pattern generator in C++, based on Jonathan McCabe's algorithm.

xdxD 08/31/2016 at 05:140 Comments

I finally understood why the patterns stabilized quickly and why the generated pictures didn't look like J. McCabe's... Turns out that I made a mistake in writing the algorithm. The program used to to this:

  1. Generate activator and inhibitor arrays.
  2. Compute variation arrays for each scale.
  3. Find the smallest variation over all scales and store the corresponding scale.
  4. Update all pixels based on this one scale.

At one given time step, all pixels of the image were updated on one scale only. And that's not the intended behavior. Instead, the algorithm should work like that:

  1. Generate activator and inhibitor arrays.
  2. Compute variation arrays for each scale.
  3. For each pixel individually, find which scale has the smallest variation.
  4. Update each pixel based on the local best scale.

This way, we really get multi-scale patterns. The pictures are awesome now, and keep evolving all the time. I also implemented a simple point symmetry around the origin. I'll improve that later. And finally, I started playing around with color maps to get something more fun than the black and white pictures. A three-color gradient looks pretty nice (black to dark red to white, for example).

Discussions