-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfinityloop.pde
More file actions
109 lines (90 loc) · 2.26 KB
/
Infinityloop.pde
File metadata and controls
109 lines (90 loc) · 2.26 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
ArrayList<Layer> layerList;
color bgColor;
String str;
int spacing;
int layerAmount;
boolean randomColor;
boolean activateRotation;
float speed;
boolean fade;
int limit;
//int screenWidth;
//PFont font;
//ArrayList<PGraphics> graphiclayerList;
void setup() {
size(1000, 1000, P3D);
//fullScreen();
background(255);
smooth(8);
textMode(SHAPE);
//arraylist because of pop and push
//delete condition
str = "INFINITYLOOP";
//str = "INFIN";
//str = "teamhula";
layerList = new ArrayList<Layer>();
//font = createFont("hula.ttf", 24);
//textFont(font);
spacing = 5;
layerAmount = 8;
randomColor = false;
speed = 1.02;
activateRotation = true;
fade = false;
limit=200;
for (int i = 0; i< str.length(); i++) {
//scale factor übergeben , mit minus init und kriterum für ab +scale
layerList.add(new Layer(str.charAt(i), color(random(255), random(255), random(255)), speed));
//createGraphics(40, 40);
}
}
void draw() {
if (!fade) {
background(bgColor);
}
translate(width/2, height/2);
for (int i = 0; i<layerAmount; i++) {
if (i==0) {
printLetter(i);
} else
if (layerList.get(i-1).getScale()>spacing) {
printLetter(i);
if (layerList.get(layerAmount-1).getScale()>spacing) {
layerList.get(0).reset();
if (!fade) {
if ((layerList.get(0).getLetter() == ('T') || layerList.get(0).getLetter() ==('I') || layerList.get(0).getLetter() ==('N') || layerList.get(0).getLetter() ==('F')|| layerList.get(0).getLetter() ==('Y'))) {
bgColor = layerList.get(0).getColour();
if (randomColor) {
layerList.get(0).setColour();
}
}
}
layerList.add(layerList.get(0));
layerList.remove(0);
}
}
}
}
void printLetter(int i) {
pushMatrix();
layerList.get(i).show();
popMatrix();
}
void changeRotationMode() {
activateRotation = !activateRotation;
}
void changeColorMode() {
randomColor = !randomColor;
}
void keyPressed() {
switch(key) {
case 'r':
changeRotationMode();
println("Rotation fixed:" + " " + !activateRotation);
break;
case 'c':
changeColorMode();
println("Colormode active:" + " " + randomColor);
break;
}
}