Archive

Posts Tagged ‘boids’

core boids

July 10th, 2011 No comments

coreboids screenshotso it’s been nearly 6 years since i posted here about pyboids…  and since i love the idea of the boids algorithm so much (and was trying to play with core animation), i decided to try to write boids using core animation.  it’s imperfect, but it works (and, technically speaking, it is 3d, although i don’t really have the functionality to rotate and such to prove it… well, not yet anyway).

the cool thing is that (theoretically speaking), this same code can easily run (without many changes) on an iOS device.  core animation itself is really powerful – it helps make snazzy apps possible by making animations really simple (in many cases, core animation takes care of the animation for you, automagically and behind the scenes).

for those who don’t know, boids is an algorithm developed by craig reynolds to simulate the flight of birds.  a good explanation (and pseudocode) of the algorithm can be found here.

Categories: code Tags: ,

pyboids!

August 6th, 2005 2 comments

greets. so these few days, i’ve been playing around with the boids algorithm, trying to write a simple implementation. i finally succeeded in doing so, in python, in under 125 lines. its pretty simple though but really cool.

boids is a “distributed behavioral model,” representing how birds fly or fish swim or whatnot. that link is a pretty good discussion of the algorithm, and this page has some pseudo code for the algorithm.

the really cool thing is how changing the rules really affects where the objects go. so for now, my implementation uses pygame and uses boxes rather than birds.

here is a picture:

oh yeah! and i am posting using drivel! – it seems to works great!

Categories: code Tags: ,