Web Log

Flocking Progress

Flocking behavior was implemented today in my Curious Nature project. I’m pleased with the line quality and general shape so far, but there are a couple of obvious challenges.



One challenge is performance. Running 300 objects at once slowed the program considerably. I might have to find a more efficient way to animate soon. These images were created with 30 objects. I want a more complex, layered composition, though. The other challenge is keeping the objects from collecting along the sides on the screen and bouncing around — they’ve clearly been doing this in the second image. This is an easier problem to fix. I can either replace the bouncing behavior with a wrapping function so objects appear on the other side of the screen after leaving it, or I can add a repelling force to the sides to redirect objets back to the center of the screen. I’ll explore both.