-
Notifications
You must be signed in to change notification settings - Fork 5
/
coraline.pde
58 lines (39 loc) · 942 Bytes
/
coraline.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
// Manuale di Programmazione Cinematografica
// Daniele Olmisani, 2016
// Coraline (2009)
final color PAPER = color(100, 145, 140);
final color INK1 = color(130, 90, 50);
final color INK2 = color(90, 65, 25);
final color INK3 = color(30, 30, 30);
void setup() {
size(480, 640);
noLoop();
}
void draw() {
float s = min(width, height) / 4.8;
translate(width/2.0, height/3.0);
background(PAPER);
drawButton(-s, 0, s);
drawButton( s, 0, s);
save("coraline.png");
}
void drawButton(float x, float y, float s) {
pushMatrix();
translate(x, y);
float l0 = 0.07*s;
float l1 = 0.11*s;
float l2 = 0.16*s;
fill(INK1);
stroke(INK2);
strokeWeight(l0);
ellipseMode(CENTER);
ellipse(0, 0, s, s);
fill(INK3);
noStroke();
rotate(-PI/3.0);
ellipse(-l1, -l1, l2, l2);
ellipse( l1, -l1, l2, l2);
ellipse( l1, l1, l2, l2);
ellipse(-l1, l1, l2, l2);
popMatrix();
}