xxxxxxxxxx
77
let myScale = 0.01,
radius = 10,
nSteps = 360,
width = 600,
height = 600,
phy_radians = 2.4,
blobs = 200,
pixel_size = 1;
var currStep = 0;
function setup() {
createCanvas(width, height, WEBGL);
pixelDensity(pixel_size);
var seed = int(random() * 100000);
noiseSeed(seed);
console.log(seed);
noiseSeed(2423)
// noiseSeed(2);
// noiseSeed(6);
// noiseSeed(8);
colorMode(HSB);
noStroke();
frameRate(60);
// frameRate(5);
background(0);
}
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 drawer(theta, n, noise_theta) {
let this_scale = (theta / TWO_PI),
this_radius = radius * this_scale,
x = width / 2 + this_radius * cos(theta + noise_theta + 0.3 * noisy(n, 0, noise_theta)),
y = height / 2 + this_radius * sin(theta + noise_theta + 0.3 * noisy(n, 0, noise_theta));
fill(color(this_radius * noisy(n, 0, noise_theta), 100, 100));
ellipse(x, y,
this_scale * noisy(n, 3, noise_theta),
this_scale * noisy(n, 0, noise_theta));
}
function draw() {
background(0);
// fill(0, 0.1);
let theta = map(frameCount % 360, 0, 360, 0, TWO_PI);
translate(-300, -300, -500 + 500 * cos(theta));
// 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 mult = -3; mult < 4; mult++) {
var noise_theta = map((frameCount * mult) % nSteps, 0, nSteps, 0, PI);
// if (mult % 2 == 1) noise_theta *= -1;
for (var n = blobs; n >= 0; n--) {
let theta = (n * phy_radians)
drawer(theta, n, noise_theta);
}
}
if (frameCount <= nSteps) {
frameRate(5);
saveCanvas("both-ways-again-" + nf(frameCount, 3) + ".png")
}
}