1. //sandstorm_140716c

     
  2. //sandstorm_140716a

     
  3. //polarPositive_140715b

     
  4. //sandstorm_140716b

     
  5. //polarNegative_140715a

     
  6. //polarPositive_140715a
    PointPosition p = new PointPosition();
    boolean alternate = false;
    int threshold;
    color pColor;

    void setup(){
      background(255);
      size(500,750);
      p.pos.x = 0;
      p.pos.y = 0;
    }

    void draw(){
      threshold = 1;
      pColor = color(
                red(int(map(randomNormal(),0,1,0,255))),
                green(int(map(randomNormal(),0,1,0,255))),
                blue(int(map(randomNormal(),0,1,0,255))),
                alpha(int(map(randomNormal(),0,1,0,255)))
               );
      fill(0,1);
      rect(-2,2,width+2,height+2);
      p.tpos.x = cos(millis()/3)*width/3;
      p.tpos.y = sin(millis())*height/3;
      translate(width/2,height/2);
      stroke(pColor);
      p.update();
      p.render();
      filter(BLUR,0.58);
    }

    class PointPosition {
      PVector pos = new PVector();
      PVector tpos = new PVector();
      void update(){
        loadPixels();
        for (int k=width+1; k<pixels.length-width-1; k++) {
          threshold = setThreshold(threshold,1,50);
          if (brightness(pixels[k]) < threshold) {
            pixels[k] = pixels[k] » 1;
          } else {
            pixels[k] = pixels[k] « 17; //12 //17
          }
        }
        updatePixels();
        pos.lerp(tpos,0.9);
      }
      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;
    }

    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);
    }

     
  7. Check out Adam Ferriss’ new web app Gush. It’s awesome!

     
  8. //normalClouds_140710g

     
  9. //normalClouds_140710f

     
  10. //normalClouds_140710e