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);
}
}
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);
}
}
comments
loading...
Add a comment:

This sketch has a