Boids

Basic flocking behavior question

LQ23's picture

I am trying to get a handle on the Particle Tools and am having quite a rough time of it. Does anyone have a very simple QTZ or tutorial that simply shows how to get some number of objects onto the screen and flocking about?

There seems to be some hat trick I am missing. I can't keep the boids from flying off the screen never to be seen again.

The demos and sample projects I have seen are quite complex and while I would love to delve into them at some point, am currently interested in a much simpler base to work from.

Thanks in advance!

OpenCL Boids (Composition by M.Oostrik)

Author: M.Oostrik
License: (unknown)
Date: 2010.12.18
Compatibility: 10.6
Categories:
Required plugins:
(none)

---UPDATE 2.2---

  • fixed crash on changing boid or tail count
  • updated boid system so it makes more sense (at least to me ;)
  • cleaned up code and patch knots
  • dramatic increase of initiation time
  • (re)introduced some parameters

---UPDATE 2.1---

  • textured tails

Contributions by George Toledo.

  • correct function for line to triangle strip conversion
  • memory fence implementation (barrier(CLK_LOCAL_MEM_FENCE)

The purpose of this project was to get a better insight in OpenCL, it worked! For now i will work on other stuff, but in the future there will be new versions.

---ORIGINAL POST (2.0) ---

Dust and I were working on boids some months ago for a generative artwork. I got distracted by other projects, but recently i had some time to spare, so i decided to rewrite the code for the purpose of sharing. Here it is...

Sources:

  • The current Boid system is based on this C++ code by Christopher Kline.
  • My research started with this page from Conrad Parker. -Inspired by this demo. The inputs are very understandable and easy to handle.

Contributions by George Toledo.

  • GLpointstructure is replaced by a mesh renderer
  • Boids in trackball for superior visuals