Monday, January 18, 2010

Pointed pointillism

//Based on Ink by Johnny
  
PVector[] locations = new PVector[40];

void setup() {
  size(800, 600, P2D);
  background(0);
  for(int i = 0; i < locations.length; i++) {
    locations[i] = new PVector(random(0, width), random(0, height));
  }
}

void draw() {
  for(int i = 0; i < locations.length; i++) {
      stroke(locations[i].x/2, locations[i].y/2,random(0, 255),80);
    point(locations[i].x + 400*sin(locations[i].x/10), locations[i].y + 300*sin(locations[i].y/10));
    locations[i].x += random(-1, 1);
    locations[i].y += random(-1, 1);
  }
}

    class PVector {
    float x, y;

PVector(float ix, float iy) {
  x = ix;
  y = iy;
}}

infoinfo

submitted by: DARYL_Gamma
views: 

Based on Ink by Johnny. No idea why the points accumulate along edges in that way, I must admit.

treeThis sketch has a parent
Tags:

commentscomment

loading loading...

 

Add a comment: