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 to pass the entire arraylist of particles to each particle, which we then use to compare a local particle with a remote particle, one by one each time we redraw.This first example will loop through all available particles, drawing lines between particles within a particular distance (in this case, ~100 pixels).Source Code
Tag Archive for processing
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 each distance direction, x-y-z). Once we know the distance between two particles, we can use that to check if two are between an upper distance limit – if so, we’ll draw a line between them.Source Code
Related Posts:
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 iteration of localised calculations.Source Code
Related Posts:
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
Related Posts:
exploring pvec
Might as well use our little PVec class to do something interesting, wouldn’t you say?Source Code
Related Posts:
pvec tricks
This is more of an oddity than anything else. I thought it might be useful to see how far I could go working the PVector class of processing into something processingjs could interpret and use. Firstly I dug deep into the processing core library and found the PVector.class file, then opened and read through it using a very nifty Java decompiler.Source Code