xxxxxxxxxx
43
function setup() {
createCanvas(900, 900);
count = 1200;
cols = ["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#48bfe3","#56cfe1","#64dfdf","#72efdd","#80ffdb"];
dots = [];
for (i = 0; i < count; i++){
dots[dots.length] = new Dot(width / 2, height / 2, i);
}
noFill();
strokeWeight(0.1);
}
function draw() {
background(0);
for(i = 0; i < dots.length; i++){
dots[i].update();
}
}
class Dot{
constructor(x, y, index){
this.pos = createVector(x, y);
this.index = index;
this.col = color(cols[floor(this.index * 0.01) % cols.length]);
}
update(){
this.pos = createVector(noise(sin((frameCount + this.index) * 0.001), frameCount * 0.0005) * this.index, noise(sin((frameCount + this.index) * 0.0017), frameCount * 0.0005) * this.index);
stroke(this.col);
if(this.index > 0){
// strokeWeight(noise((frameCount + this.index)* 0.0011114) * 2)
line(this.pos.x, this.pos.y, dots[this.index -1].pos.x, dots[this.index - 1].pos.y)
}
circle(this.pos.x, this.pos.y, (count - this.index) * 0.1);
}
}