• fullscreen
  • artegenerativo08.pde
  • //import processing.opengl.*;
    
    float pos1[ ];
    float pos2[ ];
    float velx[ ];
    float vely[ ];
    float col[ ];
    int q = 2000;
    void setup() {
      size(800, 400);
      background(0);
      smooth();
    
      velx = new float[q];
      vely = new float[q];
      pos1= new float[q];
      pos2= new float[q];
      col = new float[q];
    
      for (int i=0;i<q;i++) {
    
        pos1[i]= random(width);
        pos2[i]= random(height);
        col[i]= random(255);
      }
    }
    
    void draw() {
      strokeWeight(0.75);
      for (int i=0;i<q;i++) {
        velx[i] = random(-2, 2);
        vely[i] = random(-2, 2);
        stroke(col[i]);
        point(pos1[i], pos2[i]);
        pos1[i]+=random(velx[i]);
        pos2[i]+=random(vely[i]);
    
        if ((pos1[i] >= width) || (pos1[i] <= 0)) {
          pos1[i] = random(width);
        }
        if ((pos2[i] >= height) || (pos2[i] <= 0)) {
          pos2[i] = random(height);
        }
      }
    }
    
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Eduardo Obieta

    Arte Generativo. Hackpact Dia 08

    Add to Faves Me Likey@! 2
    You must login/register to add this sketch to your favorites.

    hackpact. Generative Art. Day 08. More info about this hackpact http://artegenerativo.laad.com.mx

    David Kay
    8 Nov 2011
    this is amazing and beautiful. def inspiring as well.
    Eduardo Obieta
    9 Nov 2011
    Thank's David.
    A.S. Hollander
    11 Nov 2011
    Wow! Really neat.
    David Kay
    13 Nov 2011
    http://www.openprocessing.org/visuals/?visualID=45818 if youd want to check out what ive been doing in your code.
    Eduardo Obieta
    13 Nov 2011
    Thanks A.S. Hollander and again David :)
    You need to login/register to comment.