Here we’ll see some chaotic interaction happening between our particles – we can tweak the interaction parameters (e.g. interact(particles_,1,false,-1,40) is where all the magic happens) to allow for different attraction and repulsion forces between each of the particles and their environment. Source Code int Resolution; … Read More →
Tag Archives: code
particle attraction
This time round we’ll add an attraction force into the mix. Each particle has repulsion and attraction interactions with all other particles, which result in ‘path of least resistance’ geometric configurations. In this example we’ll be drawing both the particles and the forces. Source Code … Read More →
particle forces
Here’s a subtle variant on the last post – this time focussing more on the forces between the particles than the particles themselves. To do this, we’ll only make a few changes – firstly turn off the background(0); line, and make our particles smaller. Essentially … Read More →
push
This time round we’ll assert some basic forces on our particles. First of all we’ll add a repulsion force between all particles, pushing them away from each other. Secondly we’ll insert some boundaries for the particles to remain within, with the walls of the sketch … Read More →
distance
Now we’re going to begin doing more interesting things with our particles. Since we have a decent (yet small) PVec class to maintain details about location and motion, we’ll begin to map out interactions between particles. For this to work, we need to be able … Read More →
particle vectors
Now that we have animated particles, moving on sin waves, we can test each one to see how far away it’s neighbours are. In this example, we’ll use the PVec class again to check the distance (by finding the square root of the squares of … Read More →
particle patterns
We’ll be using our little PVec class to form the basis of some more interesting animated interactions between particles. In this case, all we’re doing is moving particles based on a grid relationship, but already we can see some ‘macro’ behaviours popping up through the … Read More →
Sin and Cos
Sin and waves can be used to create simple and visually interesting patterns. This example uses the sin function to create a two dimensional pattern, with the sin value adjusting the radius of each circle. Source Code ArrayList balls = new ArrayList(); int mode = … Read More →
exploring pvec
Might as well use our little PVec class to do something interesting, wouldn’t you say? Source Code PVec mouse; ArrayList balls = new ArrayList(); int ticker; int W; int w; int H; boolean online; float r; float theta; float theta_vel; float theta_acc; float dir; void … Read More →
faking gravity
This time we’ll be faking gravity on our particles. Each time we redraw, we’ll add a velocity vector of (0,1,0), pushing the particles down the screen. I’ve drawn the force vectors for both particle and boundary interactions, as well as the boundary objects themselves, to … Read More →