xxxxxxxxxx
final float rGap = 3;//gap between radices
final float aGap = 6;//gap between points on the same arc
final int maxRad = 260;
int nbOsc;
float A;
PVector nRoot = new PVector(random(123), random(123)), nSpeed;
void setup(){
size(750, 350, P3D);
noFill();
strokeWeight(2);
initialize();
}
void initialize(){
nSpeed = new PVector(random(-.04, .04), random(-.04, .04));
nbOsc = (int)random(2, 10);
A = random(20, 200);
}
void draw(){
background(0);
translate(width/2, height/2);
rotateX(PI/2);
rotate(float(frameCount)/190);
nRoot.add(nSpeed);
float x, y, z, n;
for (float i = 0; i < maxRad; i += rGap)
{
beginShape();
stroke(255, map(i, 0, maxRad, 0, 120), 20, map(i, 0, maxRad, 140, 110));
float nbPts = TWO_PI * i / aGap;
for (float j = 0; j < nbPts; j ++)
{
x = i * cos(j * TWO_PI / nbPts);
y = i * sin(j * TWO_PI / nbPts);
n = noise(nRoot.x + x/100, nRoot.y + y/100);
z = sin(nbOsc * j * TWO_PI / nbPts) * map(i, 0, maxRad, 0, A) * n;
vertex(x, y, z);
}
endShape(CLOSE);
}
}
void mouseClicked(){
initialize();
}