I wanted to simulate belief systems that vary over time. I decided to use isolines on a triangle mesh.
To make isolines at some threshold t, I fill each triangle according to these rules:
- No vertices meet the threshold. 0% fill.
- One vertex meets the threshold. 25% fill
- Two vertices meet the threshold. 75% fill
- Three vertices meet the threshold. 100% fill
Note there's no 50% fill. This set of rules seems like it might cause problems. Let's think about continuity. If the value goes from t - ɛ to t + ɛ, the fill should change only a tiny bit. Does it?
I found this triangle rather unintuitive, and I was thinking I might have to abandon this approach. I decided to add a few more triangles to see how it would behave relative to neighbors. Try changing the c slider to see what happens:
It does look like isolines are continuous. Good! I wasn't sure until I built this diagram to let me try out different scenarios. I will use these for rendering.
This is called Meandering Triangles. Also see this beautiful shadertoy.
I wanted to make these regions round, and experimented here, but never got it working the way I wanted.
2 TODO Simulation#
I decided on a two-axis model, using yellow-blue for one axis and red-green for the other axis. Thare are various two-axis political spectrum models including the Nolan chart and the Pournelle chart. I also took inspiration from the B-Z reaction and the Gray-Scott diffusion reaction system.
I want A and B to be influenced by the map. I tried a few different models:
- A += 0.01 * B
- B -= 0.01 * A
Looks cool but not interesting enough. Each node's behavior is independent of all other nodes. I think that's not what I'm going for.
2.2. Reaction-diffusion (R-D)
- A += avg(A) - A * B * B + feed * (1 - A)
- B += avg(B) + A * B * B - (kill + feed) * B
This is really hard to tune. See Robert Munafo's parameter map visualization. There are large areas that lead to uninteresting behavior. I got some interesting behavior but it rapidly evaporated. This seems like a hard problem that's been studied on grids but not on triangle meshes like I have. I decided to instead try to design something that's stable so that I don't have to tune the parameters so carefully.
2.3. Belousov-Zhabotinsky (B-Z) reaction
B-Z seems to have less parameter tuning than R-D. See this introduction including code. I tried this, and it worked without any tuning, but it wasn't the effect I'm looking for (which I admit I don't know what I'm looking for).
2.4. Manual event generation
I had another idea: place some towns on this map manually, then let the reader click on them to trigger simulation events (war, famine, diplomacy, etc.). However, I think this would be a bit more involved, and I decided to leave it for another project.