Thursday, September 16, 2010

Scribble variation

// original scribble by digehode

int width=800;
int height=400;
float x,y;
float lastx,lasty;

void setup(){
    size(width,height);
    x=0;
    y=0;
    lastx=0;
    lasty=0;
    background(255);
    smooth();
}
  
void draw(){
  for(int i = 0; i< 10; i++){
  stroke(random(256),random(256),random(256));
  lastx=x;
  lasty=y;
  float factor = 20*sin(frameCount/10.0);
  x=x+random(-factor,factor);
  y=y+random(-factor,factor);
  
  if(x>width)
    x=width;
  if(x<0)
    x=0;
  if(y>height)
    y=height;
  if(y<0)
    y=0;
  
  line(x,y,lastx,lasty);
  }
}

info info

submitted by: DARYL_Gamma
views: 33


treeThis sketch has a parent
Tags:

comments comment

loading loading...

 

Add a comment: