xxxxxxxxxx
68
splats = []
function setup() {
createCanvas(600, 600);
}
function draw() {
background(220);
for(var j = 0; j < 5; j +=1){
var c = new Ink();
splats.push(c);
}
print(splats);
for(var i = 0; i < splats.length; i ++){
splats[i].draw();
}
}
function setup() {
createCanvas(400, 400);
angleMode(RADIANS);
}
class Ink{
constructor(){
this.x = random(0, width);
this.y = random(0, height);
this.nSteps = random(100, 300);
this.r = width * random(0.05, 0.15);
this.irr = this.r * random(0.1, 0.7);
}
draw(){
print("hi");
push();
translate(this.x, this.y);
var step = PI / 300;
var radius = this.r;
strokeWeight(3);
fill('black');
noLoop();
beginShape();
for(var currStep = 0; currStep < this.nSteps; currStep++){
var t = map(currStep, 0, this.nSteps, 0, TWO_PI);
var irr = 50;
var offset = random(-irr, irr);
var px = (radius + offset) * cos(t) ;
var py = (radius + offset) * sin(t) ;
curveVertex(px, py);
print('hello');
}
endShape(CLOSE);
pop();
}
}