-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathY.pde
55 lines (40 loc) · 914 Bytes
/
Y.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
48
49
50
51
52
53
54
class GG extends Composition {
int maxDim = width;
GG() {
compose();
}
void compose() {
if (width > height) {
maxDim = width;
} else {
maxDim = height;
}
}
void display() {
background(255);
noStroke();
fill(0);
for (int i = 0; i < 6; i++) {
randGrid();
}
}
void randGrid() {
int min = 8;
int max = 64;
//int expon = int(random(3, 5));
//int unit = int(pow(2, expon));
int unit = int(random(min, max));
float ss = map(unit, min, max, 5, 3);
float sp = map(unit, min, max, .4, .2);
float gr = map(unit, min, max, 255, 0);
for (int x = unit; x < width-unit; x += unit) {
for (int y = unit; y < height-unit; y += unit) {
//point(x, y);
if (random(1) > sp) {
fill(0);
rect(x, y, ss, ss);
}
}
}
}
}