Processing – (Not so) Glitchy Gravity
Posted By: Jordan ParsonsWell I’m trying to wrap my head around vectors in processing because I am not giving up on my flocking simulation and vectors seem to be key to the navigation. So I am following some tutorials by Daniel Shiffman. They are some very nice tutorials and I worked on adapting his gravity tutorial, so that the objects rotate, and move side to side and decelerate when they hit walls. I am having some serious issues with glitching when they settle to the floor and every now an then one goes right through a wall. I can’t really explain it. As always any tips or thoughts are appreciated and welcome. By the way hit space to smack the boids up in the air. http://www.jordanparsons.com/processing/gravity_v1/
Edit:
Thanks to Adam Thomas I made a series of changes to the code, and its much more stable. I also added a holder class so that I can implement the boids with a for loop instead of by hand. The new source is bellow, the old is still avaliable if you check the old app above. Here is the new version.
http://www.jordanparsons.com/processing/gravity_v2/






