-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom_mandala.pde
47 lines (42 loc) · 1.02 KB
/
random_mandala.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
This sketch builds on a prior work, "I don't even know what to call this", created by Federico Renteria
http://studio.sketchpad.cc/sp/pad/view/ro.9Zcqp2HsPtlmR/rev.1325
*/
float x, theta1, theta2, xthick, ythick;
float side = 500, symmetry=8;
float xlocation = 500, ylocation = 500;
boolean stopped = false;
void setup() {
frameRate(1);
size(1000, 1000);
//fullScreen();
noStroke();
ellipseMode(RADIUS);
}
void draw() {
if (random(1)<0.05)
{
background(255, 255, 255);
}
x=random(side);
//xthick = random(side);
theta1=random(TWO_PI/symmetry);
theta2=random(TWO_PI/symmetry);
//ythick = random(side);
fill(random(255), random(255), random(255));
ellipse(xlocation, ylocation, x, x);
fill(random(255), random(255), random(255));
for (int i = 0; i < symmetry; i = i+1) {
arc(xlocation, ylocation, x, x, theta1+2*PI*i/symmetry, theta1+theta2+2*PI*i/symmetry);
}
}
void mousePressed() {
if (!stopped) {
stopped = true;
noLoop();
} else
{
stopped = false;
loop();
}
}