3º exercício
Animação da experiências do módulo anterior.
Primeira experimentação:
«Uma tautologia / sempre na expectativa de uma heterologia»
boolean tauto = true;
float rot = 0;
float rot2 = 0;
void setup() {
size (200, 600);
smooth();
background(0);
}
void draw() {
//TAUTOHETERO
PFont Main = loadFont("BebasNeueBold-55.vlw");
background (0);
fill(225);
textFont(Main);
for (int y=30; y<=470; y=y+40) {
text("TAUTOLOGIA", 0, y);
}
push();
textSize(49.4);
text("HETEROLOGIA", 0, 505);
pop();
for (int y=545; y<=625; y=y+40) {
text("TAUTOLOGIA", 0, y);
}
//TAUTO
if (tauto) {
background(0);
for (int y=30; y<=650; y=y+40) {
text("TAUTOLOGIA", 0, y);
}
}
push();
rot = rot + random (-0.05,0.05);
fill(0);
noStroke();
rotate(rot);
int n = 25;
int spacing = height/n;
push();
for (int j=0; j<n; j=j+1) {
push();
for (int i=0; i<n; i=i+1) {
circle (5+(i*spacing), 10+(j*spacing), 25);
spacing = spacing+2;
scale (0.55);
}
pop();
spacing = spacing-30;
scale (2);
}
pop();
pop();
rot2 = map(sin(frameCount * 0.01), -1, 1, 0, PI*2);
fill(225);
noStroke();
rotate (rot2);
int m = 15;
int spacingB = width/m;
for (int j=1; j<m; j=j+1) {
push();
for (int i=0; i<m; i=i+1) {
circle (7+(i*spacingB), 50+(j*spacingB), 10);
scale (2);
}
pop();
scale (2.45);
}
}
void mousePressed() {
tauto = !tauto;
}