1. //unwinding_140427c

     
  2. //unwinding_140427b
    ArrayList<PointPosition> pointPosition = new ArrayList();
    float lposX, lposY;
    boolean alternate = true;
    int threshold = 135;
    int width = 1000/2;
    int[] directions = {
      (width*-1)-1,
      (width*-1)+1,
      width+1,
      width-1
    };

    void setup(){
      background(255);
      size(width,1500/2);
      startScatter();
    }

    void draw(){
      fill(255,200);
      stroke(255,200);
      rect(0,0,width,height);
      int i = 0;
      for(PointPosition p:pointPosition){
        i++;
        p.tpos.x = p.tpos.x+cos(millis()/3)*width/i*12;
        p.tpos.y = p.tpos.y+sin(millis())*width/i*12;
        p.update();
        stroke(0,100);
        p.render();
        float pDist = dist(lposX,lposY,p.pos.x,p.pos.y);
        if (pDist < width/2) {
          stroke(0,20);
          line(lposX,lposY,p.pos.x,p.pos.y);
        }
        lposX = p.pos.x;
        lposY = p.pos.y;
      }
      loadPixels();
        for (int k=0; k<pixels.length; k++) {
          int pModifier = selectRandom(directions);
          if (k > width+1 && k < pixels.length-width-1) {
            if (brightness(pixels[k]) == threshold) {
              pixels[k] = pixels[k] » 56;
            } else if (brightness(pixels[k]) > threshold) {
    //
            } else {
              pixels[k+pModifier] = pixels[k];
            }
          }
        }
      updatePixels();
      int minThreshold = 1;
      int maxThreshold = 153;
      threshold = setThreshold(threshold,minThreshold,maxThreshold);
      filter(BLUR,0.58);
    }

    class PointPosition {
      PVector pos = new PVector();
      PVector tpos = new PVector();
      void update(){
        pos.lerp(tpos,0.01);
      }
      void render(){
        point(pos.x,pos.y);
      }
    }

    int setThreshold(int threshold, int minThreshold, int maxThreshold) {
      if (threshold < maxThreshold && threshold > minThreshold && alternate) {
        threshold++;
      } else if (threshold < maxThreshold && threshold > minThreshold) {
        threshold—;
      } else if (alternate) {
        threshold = maxThreshold;
        alternate = !alternate;
      } else {
        threshold = minThreshold;
        alternate = !alternate;
      }
      return threshold;
    }

    int selectRandom(int[] cases){
      int selected = int(random(cases.length));
      int output = cases[selected];
      return output;
    }
     
    void startScatter(){
      for (int i=0; i<width; i++) {
        PointPosition p = new PointPosition();
          lposX = width/2+cos(i)*width/3;
          lposY = height/2+sin(i)*width/3;
          p.pos.x = width/2;
          p.pos.y = height/2;
          p.tpos.x = width/2+cos(i)*width/3;
          p.tpos.y = height/2+sin(i)*width/3;
        pointPosition.add(p);
      }
    }

     
  3. //shell_140727c

     
  4. //shell_140727b

     
  5. //shell_140727a

     
  6. //shell_140726b

     
  7. //shell_140726a

     
  8. //vapor_140723a

     
     
  9. //vapor_140723a
    ArrayList<PointPosition> pointPosition = new ArrayList();
    boolean alternate = false;
    int threshold = 135;
    color pColor;
    int width = 500,
        height = 750;
    int[] directions = {
      (width*-1)-1,
      (width*-1)+1,
      width+1,
      width-1
    };

    void setup(){
      background(255);
      size(width,height);
      startScatter();
    }

    void draw(){
      if (frameCount % 36 == 0) {
        pColor = color(
                  red(int(map(randomNormal(),0,1,0,135))),
                  green(int(map(randomNormal(),0,1,0,135))),
                  blue(int(map(randomNormal(),0,1,0,135)))
                 );
      }
      fill(pColor,2);
      stroke(pColor,2);
      rect(-2,-2,width+2,height+2);
      int i = 0;
      for(PointPosition p:pointPosition){
        i++;
        p.tpos.x = p.tpos.x+cos(millis()/3)*width/i*12;
        p.tpos.y = p.tpos.y+sin(millis())*width/i*12;
        p.update();
        p.render();
      }
      loadPixels();
      for (int k=width+1; k<pixels.length-width-1; k++) {
        int pModifier = selectRandom(directions);
        if (brightness(pixels[k]) == threshold) {
          pixels[k+pModifier] = pixels[k] « 25;
          pixels[k] = pixels[k+pModifier] » 1;
        }
      }
      updatePixels();
      threshold = setThreshold(threshold,2,254);
    }

    class PointPosition {
      PVector pos = new PVector();
      PVector tpos = new PVector();
      void update(){
        pos.lerp(tpos,0.01);
      }
      void render(){
        stroke(255,5);
        point(pos.x,pos.y);
        line(pos.x,pos.y,tpos.x,tpos.y);
      }
    }

    int setThreshold(int threshold, int minThreshold, int maxThreshold) {
      if (threshold <= maxThreshold && threshold >= minThreshold && alternate) {
        threshold++;
      } else if (threshold <= maxThreshold && threshold >= minThreshold) {
        threshold—;
      } else if (alternate) {
        threshold = maxThreshold;
        alternate = !alternate;
      } else {
        threshold = minThreshold;
        alternate = !alternate;
      }
      return threshold;
    }

    void startScatter(){
      for (int i=0; i<width*10; i++) {
        PointPosition p = new PointPosition();
          p.pos.x = width/2;
          p.pos.y = height/2;
          p.tpos.x = width/2+cos(i);//*width/3;
          p.tpos.y = height/2+sin(i);//*width/3;
        pointPosition.add(p);
      }
    }

    float randomNormal() {
      float x = 1.0, y = 1.0, s = 2.0;
      while (s >= 1.0) {
        x = random(-1.0f, 1.0f);
        y = random(-1.0f, 1.0f);
        s = x*x + y*y;
      }
      return x * sqrt(-2.0f * log(s)/s);
    }

    int selectRandom(int[] cases){
      int selected = int(random(cases.length));
      int output = cases[selected];
      return output;
    }

     
  10. //vapor_140723b