var x = 0, y = 0, z = 300,t = 0;
var vArray = [];
function setup() {
cnv = createCanvas(600, 600);
angleMode(DEGREES);
background(0);
strokeWeight(0.5)
stroke(209, 117, 19)
}
function draw() {
background(0)
translate(width/2,width/2);
x1 = t*sin(t)/2
y1 = t*cos(t)/2
fill(255,255,255,1)
stringSet(x,y,510)
stringSet(x,y,399)
stringSet(x,y,z)
stringSet(x,y,224)
stringSet(x,y,167)
stringSet(x,y,125)
stringSet(x,y,93)
stringSet(x,y,69)
stringSet(x,y,51)
stringSet(x,y,37)
fill(51, 255, 255)
strokeWeight(1)
circle(x1,y1,10+t/10);
t = t+2;
if (t>900){
t =0;
}
}
function stringSet(x,y,z){
polygon(6,x,y,z,0);starLines();
polygon(6,x,y,z*0.975,2.5);starLines();
polygon(6,x,y,z*0.955,5);starLines();
polygon(6,x,y,z*0.935,7.5);starLines();
polygon(6,x,y,z*0.920,10);starLines();
polygon(6,x,y,z*0.908,12.5);starLines();
polygon(6,x,y,z*0.897,15);starLines();
polygon(6,x,y,z*0.887,17.5);starLines();
polygon(6,x,y,z*0.879,20);starLines();
polygon(6,x,y,z*0.874,22.5);starLines();
polygon(6,x,y,z*0.869,25);starLines();
polygon(6,x,y,z*0.867,27.5);starLines();
polygon(6,x,y,z*0.865,30);starLines();
polygon(6,x,y,z,0);starLines();
polygon(6,x,y,z*0.975,-2.5);starLines();
polygon(6,x,y,z*0.955,-5);starLines();
polygon(6,x,y,z*0.935,-7.5);starLines();
polygon(6,x,y,z*0.920,-10);starLines();
polygon(6,x,y,z*0.908,-12.5);starLines();
polygon(6,x,y,z*0.897,-15);starLines();
polygon(6,x,y,z*0.887,-17.5);starLines();
polygon(6,x,y,z*0.879,-20);starLines();
polygon(6,x,y,z*0.874,-22.5);starLines();
polygon(6,x,y,z*0.869,-25);starLines();
polygon(6,x,y,z*0.867,-27.5);starLines();
polygon(6,x,y,z*0.865,-30);starLines();
}
function starLines(){
j = 0;
strokeWeight(0.1)
stroke(random(51), 255, 255)
for (let i = 0; i <6; i++){
line(vArray[j],vArray[j+1],0,0)
j = j+2;
}
strokeWeight(0.5)
stroke(209, 117, 19);
}
function polygon(n, x, y, r, angleOffset = 0) {
const angle = 360 / n
beginShape()
j =0;
for (let i = 0; i < n; i++) {
var nextX = x + cos(i * angle + angleOffset) * r
var nextY = y + sin(i * angle + angleOffset) * r
vertex(nextX, nextY)
vArray[j] = (nextX);
j = j+1;
vArray[j]= nextY;
j = j+1;
}
endShape(CLOSE)
}