Either Chaos to Calm or Calm to Chaos

This is nothing like my original idea, which was that the particles would be randomly moving around and as mouseX increased they would come together to form the shape of a folding chair. This is as far as I got, just the particle system. The noise field is made from fiddling around with the noise function in the velocity of the points. Noise fields are really great for experimenting with, because no matter what you put, it comes out looking sweet.

//cc charlotte stiles
//studied this https://openprocessing.orgsketch/10475 to understand particle systems

ArrayList points = new ArrayList();
boolean drawing = true;
 
void setup(){
  smooth();
  size(600,600);
 
  background(255);
}
 void draw(){
   fill(255,50);
   rect(0,0,width,height);
   //magic if statement, dont touch
  if(drawing == true){
    //pvector comes with x and y
    PVector pos = new PVector();
    pos.x = random(width);
    pos.y = random(height);
    //velocity
    PVector vel = new PVector();
    vel.x = (0);
    vel.y = (0);
   
    Point punt = new Point(pos, vel);
    points.add(punt);
  }
   
   //draws the points
  for(int i = 0; i < points.size(); i++){
   Point localPoint = (Point) points.get(i);

   localPoint.update();
   localPoint.draw();
  } 
}
 
 
class Point{
  PVector pos, noiseVec,vel;
  float noiseFloat;

   
  public Point(PVector _pos, PVector _vel){
    //these are for the punt
    pos = _pos;
    vel = _vel;

  }
   
  void update(){
        //This is what gives the curvy shape
    noiseVec = new PVector();
    noiseVec.x = mouseX/100*( noise(pos.x/100)-.06);
    noiseVec.y = mouseX/100*(noise(pos.y/100)-.06);
    pos.add(noiseVec);
       //warping, so it get heavier over time
    if(pos.x < 0 || pos.x > width || pos.y < 0 || pos.y > height){
         pos.x = random(width);
         pos.y = random(height);
    }
       //all that for this
       ellipse(pos.x, pos.y, 3, 3);

  }
   
  void draw(){   
    fill(0);
    noStroke();

  }
}



Comments are closed.