xxxxxxxxxx
float[] aa = new float[100];
float[] as = new float[100];
float[] f = new float[100];
float[][] hh = new float[100][100];
float cc = random(360);
void setup() {
size(800, 800, P3D);
colorMode(HSB, 360, 100, 100);
fill(130);
for (int i = 0; i < 100; i++) {
aa[i] = random(PI / 12, PI / 9);
as[i] = random(PI / 12);
f[i] = random(0.75, 0.99);
float hhh = random(380.0, 400.0);
int j = 0;
while (hhh > 0) {
hhh -= random(26.7);
hh[i][j] = hhh;
if (hh[i][j] < 30.0) hh[i][j] = 30.0;
j++;
}
}
}
float xx1, xx2, xx3, xx4, xx5, xx6, xx7, xx8;
float yy1, yy2, yy3, yy4, yy5, yy6, yy7, yy8;
float zz1, zz2, zz3, zz4, zz5, zz6, zz7, zz8;
int m = 12;
void draw() {
background(20, 20, 60);
translate(width / 2, height / 2 + 100, 0);
rotateX(-PI / 10);
rotateY(PI / 100 * frameCount/-5);
fill(20, 20, 20);
beginShape();
vertex(-width, 0, -width);
vertex(width, 0, -width);
vertex(width, 0, width);
vertex(-width, 0, width);
endShape(CLOSE);
float a = 0.0;
int i = 0;
while (a < TWO_PI) {
float r1 = 3.50;
float r2 = 12.0;
float ah = aa[i];
if (a > TWO_PI - PI / 12) ah = TWO_PI - a;
int j = 0;
while (hh[i][j] > 0.0) {
xx1 = r1 * cos(a);
xx2 = r1 * cos(a + ah);
xx3 = xx1;
xx4 = xx2;
xx5 = r2 * cos(a);
xx6 = r2 * cos(a + ah);
xx7 = xx5;
xx8 = xx6;
yy1 = -hh[i][j];
yy2 = -hh[i][j];
yy3 = -hh[i][j + 1];
yy4 = -hh[i][j + 1];
yy5 = -hh[i][j];
yy6 = -hh[i][j];
yy7 = -hh[i][j + 1];
yy8 = -hh[i][j + 1];
zz1 = r1 * sin(a);
zz2 = r1 * sin(a + ah);
zz3 = r1 * sin(a);
zz4 = r1 * sin(a + ah);
zz5 = r2 * sin(a);
zz6 = r2 * sin(a + ah);
zz7 = r2 * sin(a);
zz8 = r2 * sin(a + ah);
fill(color(cc, 100 - 2.45 * j, 100 - 2.45 * j));
segment(xx1, yy1, zz1,
xx2, yy2, zz2,
xx3, yy3, zz3,
xx4, yy4, zz4,
xx5, yy5, zz5,
xx6, yy6, zz6,
xx7, yy7, zz7,
xx8, yy8, zz8);
j++;
r1 *= 1.105;
r2 *= 1.105;
}
a += ah; //+as[i];
i++;
}
}
void segment(float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4,
float x5, float y5, float z5,
float x6, float y6, float z6,
float x7, float y7, float z7,
float x8, float y8, float z8) {
beginShape();
vertex(x1, y1, z1);
vertex(x2, y2, z2);
vertex(x4, y4, z4);
vertex(x3, y3, z3);
endShape(CLOSE);
beginShape();
vertex(x5, y5, z5);
vertex(x6, y6, z6);
vertex(x8, y8, z8);
vertex(x7, y7, z7);
endShape(CLOSE);
beginShape();
vertex(x1, y1, z1);
vertex(x3, y3, z3);
vertex(x7, y7, z7);
vertex(x5, y5, z5);
endShape(CLOSE);
beginShape();
vertex(x2, y2, z2);
vertex(x4, y4, z4);
vertex(x8, y8, z8);
vertex(x6, y6, z6);
endShape(CLOSE);
beginShape();
vertex(x1, y1, z1);
vertex(x2, y2, z2);
vertex(x6, y6, z6);
vertex(x5, y5, z5);
endShape(CLOSE);
beginShape();
vertex(x4, y4, z4);
vertex(x3, y3, z3);
vertex(x7, y7, z7);
vertex(x8, y8, z8);
endShape(CLOSE);
}