-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtron.pde
More file actions
61 lines (43 loc) · 977 Bytes
/
Copy pathtron.pde
File metadata and controls
61 lines (43 loc) · 977 Bytes
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
// Manuale di Programmazione Cinematografica
// Daniele Olmisani, 2015
// Tron (1982)
final color PAPER = color(30);
final color[] INKS = {
color(0, 135, 85),
color(255, 50, 50),
color(55, 205, 250),
};
void setup() {
size(480, 640);
noLoop();
}
void draw() {
final float S = min(width, height);
final float U = 0.002;
translate(0.5*width, 0.5*height);
scale(S);
background(PAPER);
noFill();
strokeJoin(ROUND);
strokeCap(SQUARE);
stroke(INKS[0]);
strokeWeight(U);
for (float i=-0.6; i<=0.6; i+=0.1) {
line( i, -1.0, i, 1.0);
line(-1.0, i, 1.0, i);
}
for (int i=1; i<INKS.length; i++) {
translate(0.05, 0.06);
stroke(INKS[i]);
strokeWeight(10*U);
beginShape();
vertex(0.0, 0.7);
vertex(0.0, 0.2);
vertex(0.2, 0.2);
vertex(0.2, -0.1);
endShape();
strokeWeight(15*U);
line(0.2, -0.12, 0.2, -0.04);
}
save("tron.png");
}