xxxxxxxxxx
55
let myScale = 0.01,
radius = 3.5,
nSteps = 360,
width = 600,
height = 600,
phy_radians = 2.4,
blobs = 200,
pixel_size = 1;
var currStep = 0;
function setup() {
createCanvas(width, height);
pixelDensity(pixel_size);
// noiseSeed(2);
// noiseSeed(6);
noiseSeed(8);
colorMode(HSB);
noStroke();
frameRate(60);
// frameRate(5);
}
function noisy(x, y, theta) {
// noise(x,y) == noise(-x,y) --- so add offset of radius*5
var px = (radius * 5) + (x + radius) * cos(theta);
var py = (radius * 5) + (x + radius) * sin(theta);
return noise(myScale * px, myScale * py, myScale * y);
}
function draw() {
background(0);
currStep = frameCount % nSteps;
// use these to around the loop to ensure smoothness
// var steps = [355, 355, 355, 355, 356, 357, 358, 359, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4]
// currStep = steps[frameCount % steps.length];
for (var n = blobs; n >= 0; n--) {
let theta = (n * phy_radians),
this_scale = (theta / TWO_PI),
this_radius = radius * this_scale,
x = width / 2 + this_radius * cos(theta + map(currStep, 0, nSteps, 0, TWO_PI) + 0.3*noisy(n, 0, map(currStep, 0, nSteps, 0, TWO_PI))),
y = height / 2 + this_radius * sin(theta + map(currStep, 0, nSteps, 0, TWO_PI) + 0.3*noisy(n, 0, map(currStep, 0, nSteps, 0, TWO_PI)));
fill(color(this_radius * noisy(n, 0, map(currStep, 0, nSteps, 0, TWO_PI)), 100, 100));
ellipse(x, y, this_scale * noisy(n, 3, map(currStep, 0, nSteps, 0, TWO_PI)), this_scale * noisy(n, 0, map(currStep, 0, nSteps, 0, TWO_PI)));
}
if (frameCount <= nSteps) {
// saveCanvas("phyllotatic-" + nf(frameCount, 3) + ".png")
}
}