-
Notifications
You must be signed in to change notification settings - Fork 0
dantreiman edited this page Jul 2, 2015
·
15 revisions
Chances are you've seen Conway's Game of Life. SmoothLife is an attempt to generalize Conway's game of life to a continuous domain.
Lets start with Conway's game of life. We'll begin by defining the 'inner neighborhood' M, and the 'outer neighborhood' N. Next, let's define
m = M
n = ΣN.
We can write the Game of Life update rule as a function L(n,m) such that:
L(n,m) = 0 ; n < 2
L(n,m) = 0 ; n > 3
L(n,m) = 1 ; m = 1, 1 < n < 4
L(n,m) = 1 ; m = 1, n = 3
Smoothlife uses a circular neighborhood over a field of continuous values. The 'inner neighborhood' becomes a circle, and the 'outer neighborhood' becomes a ring. The neighborhoods can now be any size, so we'll also introduce normalization constants αm and αn to keep n and m in the range of [0, 1].
inner_sum = The area of the inner circle
outer_sum = The area of the outer ring
m = ΣM / inner_sum
n = ΣN / outer_sum
Our update rule will be a continuous function S(n,m) : [0,1] x [0,1] -> [0,1]. There are many possible options for this function with widely different results, and this is an open space for exploration.
float inner_radius;
float outer_radius;
float border;
float b1, b2;
float d1, d2;
float alphan;
float alpham;
float dt;