createCanvas(windowWidth, windowHeight, WEBGL);
a[0] = 1, a[1] = 0; a[2] = -1;
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
rotateZ(frameCount * 0.01);
if (frameCount % 10 == 0) {
for (let i = 0; i < effect.length; i++) {
if (effect[i].long < 0) {
pointLight(120, 20, 120, -40, -40, 40);
specularMaterial(127, 255, 127);
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 3; j++) {
for (let k = 0; k < 3; k++) {
rotateX(a[i] * frameCount * 0.01);
rotateY(a[j] * frameCount * 0.01);
rotateZ(a[k] * frameCount * 0.01);
ellipsoid(s, s, s * 3 * sin(radians(frameCount)));
ellipsoid(s, s * 3 * cos(radians(frameCount * 1.6)), s);
ellipsoid(s * 6 * cos(radians(frameCount * 1.3)), s, s);
this.size = random(width/100, width / 80);
this.r = random(width / 8, width / 4);
this.x = random(-PI, PI);
this.y = random(-PI, PI);
this.z = random(-PI, PI);
this.long = this.maxlong;
for (let i = 0; i < this.efps; i++) {
let size2 = map(this.long, this.maxlong - i * this.kkk, this.kkk * (this.efps - i - 1), 0, PI, true);
rotateZ(this.z + this.long * 0.008 + i * 0.3);
stroke(100,this.g,this.b);
box(this.size * sin(size2));