xxxxxxxxxx
44
var a,b,c,d,x,y;
var jump = 2/3;
function setup() {
createCanvas(400, 400);
background(220);
a = createVector(0,0);
b = createVector(width,0);
c = createVector(width,height);
d = createVector(0,height);
x = random(width);
y = random(height);
}
function draw() {
strokeWeight(1);
strokeWeight(1);
point(a);
point(b);
point(c);
point(d);
for(var i = 0; i < 1000; i++){
point(x,y);
var r = floor(random(4));
if(r == 0){
x = lerp(x,a.x,jump);
y = lerp(y,a.y,jump);
}
if(r == 1){
x = lerp(x,b.x,jump);
y = lerp(y,b.y,jump);
}
if(r == 2){
x = lerp(x,c.x,jump);
y = lerp(y,c.y,jump);
}
if(r == 3){
x = lerp(x,d.x,jump);
y = lerp(y,d.y,jump);
}
}
}