xxxxxxxxxx
// Genuary2023 - 2 - Made in 10 minutes
// Started: 12:30
// Ended: 12:40
var gB, fullRes, windowRes;
var requiredFrames = 120;
var gridSize = 64;
function setup() {
windowRes = min(windowWidth, windowHeight);
createCanvas(windowRes, windowRes);
imageMode(CENTER);
colorMode(HSB, 360);
gB = createGraphics(fullRes = 1024, fullRes);
gB.colorMode(HSB, 360);
}
function draw() {
gB.clear();
gB.resetMatrix();
gB.noStroke();
gB.noFill();
for (var i = 0; i < gridSize; i += 1) {
for (var j = 0; j < gridSize; j += 1) {
gB.push();
gB.translate(i * fullRes / (gridSize - 1), j * fullRes / (gridSize - 1));
gB.fill (240, map( noise(i * 1, j * 0.1, frameCount * 0.01), 0, 1, 0, 360), 360);
gB.ellipse(0, 0, fullRes / (gridSize) * map(noise(i * 0.1, j * 0.1, frameCount * 0.05), 0, 1, 0.8, 1.25));
gB.pop();
}
}
background(240, 360, 60);
displayBuffer(gB);
}
function keyPressed() {
if (key === "g") {
saveGif('export', requiredFrames, {delay: 0, units: "frames"});
}
}
function displayBuffer(buffer) {
image(buffer, windowRes/2, windowRes/2, windowRes, windowRes);
}
function windowResized() {
windowRes = min(windowWidth, windowHeight);
resizeCanvas(windowRes, windowRes);
}