-
Notifications
You must be signed in to change notification settings - Fork 1
/
Samples.pde
93 lines (87 loc) · 2.75 KB
/
Samples.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//-------------------------- SAMPLES CLASS --------------------------//
class Samples {
float x, y, sX, sY, r, w;
color cCi, cICi, cCr;
//~~~ CONSTRUCTOR ~~~//
public Samples (float startX, float startY, float spacingX, float spacingY, float radius, float weightStroke, color colCircles, color colInsideCircles, color colCrosses) {
x = startX;
y = startY;
sX = spacingX;
sY = spacingY;
r = radius;
w = weightStroke;
cCi = colCircles;
cICi = colInsideCircles;
cCr = colCrosses;
}
//~~~ DRAW ~~~//
void draw() {
drawCircles();
drawCrosses();
}
//~~~ DRAW CIRCLES ~~~//
void drawCircles() {
for (int i = 0; i < count0_255; ++i) {
if (i<86) {
if(childrenR[i + 256*count256].getInt("happy") == 1){
big.fill(cCi);
big.noStroke();
big.ellipse(x, y + i*sY, r, r);
} else {
big.fill(cCi);
big.noStroke();
big.ellipse(x, y + i*sY, r, r);
big.fill(cICi);
big.ellipse(x, y + i*sY, r-w*2, r-w*2);
}
}
if (i>=86 && i<172) {
if(childrenR[i + 256*count256].getInt("happy") == 1){
big.fill(cCi);
big.noStroke();
big.ellipse(x+sX, y + i*sY-sY*86, r, r);
} else {
big.fill(cCi);
big.noStroke();
big.ellipse(x+sX, y + i*sY-sY*86, r, r);
big.fill(cICi);
big.ellipse(x+sX, y + i*sY-sY*86, r-w*2, r-w*2);
}
}
if (i>=172) {
if(childrenR[i + 256*count256].getInt("happy") == 1){
big.fill(cCi);
big.noStroke();
big.ellipse(x+sX*2, y + i*sY-sY*172, r, r);
} else {
big.fill(cCi);
big.noStroke();
big.ellipse(x+sX*2, y + i*sY-sY*172, r, r);
big.fill(cICi);
big.ellipse(x+sX*2, y + i*sY-sY*172, r-w*2, r-w*2);
}
}
}
}
//~~~ DRAW CROSSES ~~~//
void drawCrosses() {
big.stroke(cCr);
big.strokeWeight(w);
strokeCap(SQUARE);
big.noFill();
for (int i = count0_255; i < 256; ++i) {
if (i<86) {
big.line(x-(r/2-1.5*w), (y + i*sY)-(r/2-1.5*w), x+(r/2-1.5*w), (y + i*sY)+(r/2-1.5*w));
big.line(x-(r/2-1.5*w), (y + i*sY)+(r/2-1.5*w), x+(r/2-1.5*w), (y + i*sY)-(r/2-1.5*w));
}
if (i>=86 && i<172) {
big.line(x+sX-(r/2-1.5*w), (y + i*sY-sY*86)-(r/2-1.5*w), x+sX+(r/2-1.5*w), (y + i*sY-sY*86)+(r/2-1.5*w));
big.line(x+sX-(r/2-1.5*w), (y + i*sY-sY*86)+(r/2-1.5*w), x+sX+(r/2-1.5*w), (y + i*sY-sY*86)-(r/2-1.5*w));
}
if (i>=172) {
big.line(x+sX*2-(r/2-1.5*w), (y + i*sY-sY*172)-(r/2-1.5*w), x+sX*2+(r/2-1.5*w), (y + i*sY-sY*172)+(r/2-1.5*w));
big.line(x+sX*2-(r/2-1.5*w), (y + i*sY-sY*172)+(r/2-1.5*w), x+sX*2+(r/2-1.5*w), (y + i*sY-sY*172)-(r/2-1.5*w));
}
}
}
}