xxxxxxxxxx
//inspiration from Daniel Shiffman's youtube channel coding train - flow fields
let inc = 0.1;
let scl = 50;
let cols, rows;
let zoff = 0;
const numPoints = 5;
const
//var fr;
void setup() {
size(800, 800);
cols = floor(width / scl);
rows = floor(height / scl);
//fr = createP('');
//noLoop();
}
void draw() {
background(#F8EDEB);
float yoff = 0;
for (int y = 0; y< rows+1; y++){
float xoff = 0;
for (int x = 0; x < cols+1; x++){
float index = (x + y * width) * 4;
float angle = noise(xoff, yoff, zoff) * TWO_PI;
PVector v = PVector.fromAngle(angle);
xoff += inc;
noStroke();
pushMatrix();
translate(x * scl, y * scl);
rotate(PI/4);
fill(#D8E2DC);
rect(0,0,scl,scl);
rotate(v.heading());
fill(#007369);
line(0,0, scl, 0);
//draw pattern element
//triangle(-scl/2,0, scl/2, 0, 0, scl/2);
fill(#FAE1DD);
noStroke();
fill(#E8E8E4);
ellipse(0,0,scl,scl/2);
fill(#FFD7BA);
rect(scl,scl,scl/2,scl/2);
// popMatrix();
popMatrix();
stroke(0,0,0)
beginShape();
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape(CLOSE);
}
yoff += inc;
zoff += 0.0001;
}
//fr.html(floor(frameRate()));
}