xxxxxxxxxx
//a experiment of drawing circles using noise
//mouseX controls scale of noise, mouseY controls the animation speed of noise
let loopArray = []; //array of loop objects
function setup() {
createCanvas(800, 800);
colorMode(HSB, 360, 100, 100, 100);
frameRate(60);
let c = 200; //starting hue
let d = width/2+250; //distance from center
let num = 4; //number of objects added
for (let a = 0; a < TWO_PI; a += TWO_PI/num) { //add loop objects in a circle
let x = cos(a)*d + width/2;
let y = sin(a)*d + height/2;
//noiseLoop(x, y, starting radius, points per circle, numbers of circle, hue)
//lower value of p per circle creates more variation, but takes up cpu
loopArray.push(new NoiseLoops(x, y, 500, 0.05, 20, c));
c += 10;
}
}
function draw() {
background(0, 0, 90);
for (let l of loopArray) {
l.show();
l.hueShift();
}
// if (mouseIsPressed && frameCount % 2 == 0) {
// save("week2Sub.png");
// console.log(3);
// }
}