xxxxxxxxxx
54
let res = 1000;
let sc = 100;
let rad = 100;
let globPts = [];
let starCount = 10000;
let starPts = [];
function setup() {
createCanvas(400, 400);
for (let i=0;i<res;i++) {
globPts.push(noise(i/100));
}
for (let i=0;i<starCount;i++) {
starPts.push(createVector(random(width), random(height)));
}
background(0);
}
function draw() {
background(0,0, 30, 30);
//background(255);
push();
strokeWeight(1);
stroke(255);
for (let s of starPts) {
stroke(255, 255*noise(floor(s.x*s.y)), 255*noise(floor(s.x*s.y)), 120*noise(floor(s.x*s.y)))
point(s.x, s.y);
}
pop();
translate(width/2, height/2);
push();
stroke(0);
strokeWeight(rad);
point(0,0);
pop();
for (let i=0;i<res;i++) {
push();
rotate(i * TWO_PI/100 + noise(i+frameCount/100)/10);
stroke(0, 10);
strokeWeight(floor(noise((i + frameCount/10)/10)*rad));
point(0, globPts[i]*sc);
pop();
}
for (let i=0;i<res;i++) {
globPts[i] = (noise((i + frameCount/50)/100));
}
}