Saturday, July 12, 2008

Vector Mathmatics

After a while, working with 3 dimensional math, you get into the habit of just thinking in vectors. This only becomes a problem when, like me, you constantly confuse addition and subtractions.

Below is the simplest flocking I have available. 10 Boids are created and placed randomly across the screen, and they then decide to huddle together. The math is being done in 3 dimensions, though the Z direction is commented out because Flash Sprites don't have a .z property.


I'm tempted to make the Z value change the sphere's size, just to see what would happen. First, though, I need to get these little Boids to follow something, say, a mouse pointer.

No comments: