1. //normalClouds_140710b

     
  2. //normalClouds_140710a

     
  3. //core_140707c

     
  4. //core_140707b

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

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

    void draw(){
      fill(255,2);
      rect(-2,-2,width+2,height+2);
      for(PointPosition p:pointPosition){
        p.tpos.x = p.tpos.x+tan(threshold)*cos(millis())*sin(threshold);
        p.tpos.y = p.tpos.y+cos(threshold)*sin(millis())*tan(threshold+p.pos.x);
        p.update();
        p.render();
      }
      loadPixels();
      for (int i=0; i<pixels.length; i++) {
        int pModifier = selectRandom(directions);
        if (i > width+1 && i < pixels.length-width-1) {
          if (brightness(pixels[i]) < threshold) {
            pixels[i] = pixels[i] » 4;
          } else if (brightness(pixels[i]) < threshold) {
            pixels[i] = pixels[i+pModifier] « 18;
          } else {
            pixels[i+pModifier] = pixels[i];
          }
        }
      }
      updatePixels();
      threshold = setThreshold(threshold,153,255);
      filter(BLUR,0.6);
    }

    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);
          p.tpos.y = height/2 + sin(i);
        pointPosition.add(p);
      }
    }

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

    class PointPosition {
      PVector pos = new PVector();
      PVector tpos = new PVector();
      void update(){
        pos.lerp(tpos,0.1);
      }
      void render(){
        int hue = int(map(tpos.x,0,width,0,255));
        int saturation = int(map(abs((height/2)-tpos.y),height/2,0,0,255));
        int brightness = int(map(tpos.y,height,0,0,255));
        color pointColor = color(hue,saturation,brightness);
        stroke(pointColor);
        point(pos.x,pos.y);
      }
    }

     
  6. //sparks_140702c

     
  7. //sparks_140702b

     
  8. //sparks_140702a

     
  9. //sparks_140701d

     
  10. //sparks_140701c
    ArrayList<PointPosition> pointPosition = new ArrayList();
    boolean alternate = false;
    float lposX, lposY;
    int threshold = 135;
    int height = 750;
    int width = 500;
    int[] directions = {
      -1,
      (width*-1)-1,
      (width*-1),
      (width*-1)+1,
      1,
      width+1,
      width,
      width-1
    };

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

    void draw(){
      fill(0,2);
      rect(-2,-2,width+2,height+2);
      for(PointPosition p:pointPosition){
        p.tpos.x = p.tpos.x+cos(p.tpos.x)*sin(millis()/threshold)*3;
        p.tpos.y = p.tpos.y+sin(p.tpos.y)*tan(millis()/threshold);
        p.update();
        p.render();
        lposX = p.pos.x;
        lposY = p.pos.y;
      }
      loadPixels();
      for (int i=0; i<pixels.length; i++) {
        int pModifier = selectRandom(directions);
        if (i > width+1 && i < pixels.length-width-1) {
          if (brightness(pixels[i]) < threshold) {
            pixels[i] = pixels[i+pModifier];
          } else {
            pixels[i+pModifier] = pixels[i];
          }
        }
      }
      updatePixels();
      threshold = setThreshold(threshold,2,255);
      filter(BLUR,0.6);
    }

    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();
          lposX = width/2+cos(i)*width/3;
          lposY = height/2+sin(i)*height/3;
          p.pos.x = width/2;
          p.pos.y = height/2;
          p.tpos.x = width/2;
          p.tpos.y = height/2;
        pointPosition.add(p);
      }
    }

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

    class PointPosition {
      PVector pos = new PVector();
      PVector tpos = new PVector();
      void update(){
        pos.lerp(tpos,0.1);
      }
      void render(){
        int hue = int(map(tpos.x,0,width,0,255));
        int saturation = int(map(abs((height/2)-tpos.y),height/2,0,0,255));
        int brightness = int(map(tpos.y,height,0,0,255));
        color pointColor = color(hue,saturation,brightness);
        stroke(pointColor);
        point(pos.x,pos.y);
      }
    }