Flocking Cellular Automata

Alright, so I decided to experiment a bit with my flocking cellular automata system inspired by Jared Tarbell. And I am definitely liking the results!! I guess I have a thing for moving line exposures.

My system has a small number of boids (for these iterations I played around 10-15). Each boid has one of the following states :

  • “Loneliness” (0 neighbors): alignment and cohesion forces applied
  • “Contentment” (1-2 neighbors): no motion
  • “Anxiety” (>2 neighbors): separation forces applied

Here is the basic structure of my program:

while (boids are not all content){

  • update boid positions
  • draw

}

Iteration I:

  • Boids generated from center image
  • Linear link drawn between each boid

v01_000

v01_001

v01_002

Iteration II:

  • Boids generated from random point
    float fx = (0.1*randomGaussian()+ 0.5) * width;
    float fy = (0.1*randomGaussian()+ 0.5) * height;
  • Linear link drawn between each boid

v02_000

v02_001

v02_002

Iteration III:

  • Boids generated from random point
  • Curvilinear link drawn between each boid

v03_000

v03_001

v03_002

Iteration IV:

  • Boids generated from random point
  • Curvilinear link drawn between each boid
  • If line has not moved from previous frame, line is drawn with a lower opacity (this is to help get rid of those opaque black lines that develop when line hasn’t moved for a while)

v04_000 v04_001 v04_002

v04_003

v04_004

v04_005

Advertisements

2 thoughts on “Flocking Cellular Automata

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