void createRadius ()
{
int count = 0;
int amount = 40;
noFill ();
while (count < amount)
{
float radius = random (60, height /2-30);
float randomStrokeWeight = random (0.1,1);
float a = 200-radius*0.80; // a = random (5, 80);
a = constrain (a, 15, 170);
stroke (255, a);
strokeWeight (randomStrokeWeight);
createDots (radius);
count++;
}
}
void createDots (float radius)
{
int centerX = width /2, centerY = height /2;
int count = 0;
int amount = int (radius/5);
float steps = TWO_PI / amount;
float angle = 0;
beginShape ();
while (count < amount)
{
float x = centerX + cos (angle) * radius;
float y = centerY + sin (angle) * radius;
vertex (x,y);
createCurve (20, angle, steps, radius, centerX, centerY, 30);
angle += steps;
count++;
}
endShape ();
}
void createCurve (int amount, float angle, float steps, float radius, int centerX, int centerY, int maxSpacing)
{
int count = 0;
while (count < amount)
{
float randomX = random (-maxSpacing, maxSpacing);
float randomY = random (-maxSpacing, maxSpacing);
float randomAngleX = random (-steps, steps);
float randomAngleY = random (-steps, steps);
float x = centerX + cos (angle+randomAngleX) * (radius+randomX);
float y = centerY + sin (angle+randomAngleY) * (radius+randomY);
curveVertex (x,y);
count++;
}
}