This is a port of Peter Keller's sample boids program to python3.
For the original Common Lisp version of boids, check out: Boids Flocking Model
NOTE: This port was taken from an earlier, unpublished snapshot of the Common Lisp version and is now somewhat out of date.
This is a naive boids implementation derived from this paper:
http://www.cs.toronto.edu/~dt/siggraph97-course/cwr87/
The boids exist in a 3D cube which is a hypertorus. However, the neighborhood equations in the vector math does not take that geometry into consideration. Visually, the error is negligible.
The various nasty constants found in the method implementations of the correction protocol are mostly due to not completing the physics all the way to dealing with boid mass and volume and for visual effect of what I thought looked nice.
-
python3 Debian: python3-all-dev http://wiki.python.org/moin/Python2orPython3
-
pygame Debian: python3-pygame http://www.pygame.org/wiki/FrequentlyAskedQuestions#Does%20Pygame%20work%20with%20Python%203?
-
python-opengl Debian: Currently not supported for python3 in Debian unstable, build from source with --prefix /usr/local http://packages.debian.org/search?keywords=python-opengl&searchon=names&suite=all§ion=all http://pyopengl.sourceforge.net/ https://code.launchpad.net/pyopengl
To try it out yourself, clone this and run:
./boids.py
- pkeller
- tmarble
This project is licensed under the permissive MIT license