xxxxxxxxxx
int v = 800; // You can change the number of vertices that comprise the spiral.
float rStep = random(.3,.7); // Change this value to generate different spirals.
boolean loop = false; // You can enable the animation, or make the program stop after displaying the specified spiral rotation. (true = animation!; false = no animation...)
float stepA = 0.000001; // You can change how fast the animation progresses. (lower stepA = faster animation; higher stepA = faaaaster animation)
boolean lines = true; // You can show or hide lines. (true = fun lines!; false = no lines...)
boolean dotsQ = false; // You can show or hide dots. (true = dots; false = no dots) (with lines enabled and dots disabled, it's especially fun to crank the vertex count up to some unreasonably large number)
int s = 1; // You can change the size of the dots.
float r = random(0,255); // Red value for the spiral stroke color.
float g = random(0,255); // Green value for the spiral stroke color.
float b = random(0,255); // Blue value for the spiral stroke color.
int sizeX = 1000; // Change the width of the stage.
int sizeY = 700; // Change the height of the stage.
float centerX = sizeX/2; // Change the x-coordinate of the center of the spiral.
float centerY = sizeY/2; // Change the y-coordinate of the center of the spiral.
int back = 0; // Change the background color.
int dotFill = 255; // Change the dot fill color.
void setup() {
size(sizeX, sizeY);
background(back);
textAlign(RIGHT, CENTER);
textSize(30);
frameRate(60);
if (loop == false) {
noLoop();
}
}
void draw() {
println(rStep + " r: " + r + " g: " + g + " b: " + b);
fill(dotFill);
int j = 0;
float tempX = 0;
float tempY = 0;
float x = 0;
float y = 0;
background(back);
if (j == 0) {
translate(centerX, centerY);
}
for (int i = 1; i <= v; i += 1) {
stroke(r/(i*0.001), g/(i*0.001), b/(i*0.001));
x = cos(2 * PI * rStep * i) * i * 2;
y = sin(2 * PI * rStep * i) * i * 2;
if (dotsQ == true) {
ellipse(x, y, sqrt(i*s), sqrt(i*s));
}
if (lines == true) {
line(x, y, tempX, tempY);
}
strokeWeight(6/pow(i, 1/1.6));
tempX = x;
tempY = y;
}
rStep += stepA;
j = 1;
}