xxxxxxxxxx
67
let x = 0;
let y = 0;
let z = 0;
let rate = 0.01;
let rate2 = 0.05;
let rate3; 0.03;
function setup() {
createCanvas(600, 600);
background(0);
noStroke();
}
function draw() {
fill(0,10);
rect(0,0,width, height);
let n = noise(x) * width;
let p = noise(y) * width;
fill(255);
// middle circles
ellipse(p, height/4, random(70,100), random(70,80));
x += rate*(-3,3);
// bottom circles
ellipse(p, height/2, random(40,60), random(40,60));
x += rate*(-5,5);
// bottom circles
ellipse(n, height/1.3, random(150,170), random(150,170));
y += rate2;
// randomly blinking circles layer
//fill(random(100));
//ellipse(n, random(100, 500), random(150,200), random(30,40));
// other testing
freq = frameCount * 0.02;
let sinVal = map(sin(freq), -1, 1, -300, 300);
let cosVal = map(cos(freq), -1, 1, -300, 300);
let tanVal = map(tan(freq), -1, 1, -300, 300);
colors = map(tanVal,-1, 1, 0, 255)
fill(colors)
//let amp = 100;
//x = x+1
x = frameCount; // moves one step each frame
ellipse(x, height/2+sinVal, 50, 10);
ellipse(x, height/2+cosVal, 50, 10);
ellipse(x, height/2+tanVal, 50, 10);
}