Adam-Assignment-04-GIF
I enjoyed working on making a GIF but found my coding limitations a frustration – I had hoped to create each letter character out of particles so that not only the letters move around but actually break up and shake apart.
//Adam Ben-Dror
//assigmnet 4 - GIF
//EMS II | Golan Levin
float x1, y1, x11, y11, x12, y12, x2, y2, x21, y21, x3, y3, x31, y31, x4, y4, x41, y41, x5, y5, x51, y51, r1, r11,
r2, r21, r3, r31, r4, r41;
float easing = 0.03;
int x = 0;
float frame =1;
float loop = 0;
void setup() {
PFont font;
font = loadFont("Biko-Bold-90.vlw");
textFont(font, 90);
size (600, 600);
x1 = 0;
y1 = 0;
fill(0);
}
void draw() {
frame++;
loop++;
if (frame > 5){
saveFrame();
frame = 1;
}
background(255);
textAlign(LEFT);
textSize(90);
pushMatrix();
translate(x1+width/2-76, y1+height/2);
rotate(r1);
text("m", x1, y1);
if (loop > 200) {
x1 += random(-3, 2);
y1 += random(-1, 2);
r1 += random(-0.5, 0.5);
}
else {
x11 = 0;
y11 = 0;
r11 = 0;
float dx = x11 - x1;
float dy = y11 - y1;
float dr = r11 - r1;
x1 = x1 + ( dx * easing );
y1 = y1 + ( dy * easing );
r1 = r1 + ( dr * easing );
}
popMatrix();
///
pushMatrix();
translate(x3+width/2-16, y3+height/2);
rotate(r3);
text("o", x3, y3);
if (loop > 200) {
x3 += random(-2, 1);
y3 += random(-1, 2);
r3 += random(-0.5, 0.5);
}
else {
x31 = 0;
y31 =0;
r31 = 0;
float dx3 = x31 - x3;
float dy3 = y31 - y3;
float dr3 = r31 - r3;
x3 = x3 + ( dx3 * easing );
y3 = y3 + ( dy3 * easing );
r3 = r3 + ( dr3 * easing );
}
popMatrix();
///
pushMatrix();
translate(x4+width/2+16, y4+height/2);
rotate(r4);
text("v", x4, y4);
if (loop > 200) {
x4 += random(-4, 3);
y4 += random(-1, 3);
r4 += random(-0.5, 0.5);
}
else {
x41 = 0;
y41 =0;
r41 = 0;
float dx4 = x41 - x4;
float dy4 = y41 - y4;
float dr4 = r41 - r4;
x4 = x4 + ( dx4 * easing );
y4 = y4 + ( dy4 * easing );
r4 = r4 + ( dr4 * easing );
}
popMatrix();
///
pushMatrix();
translate(x2+width/2+48, y2+height/2);
rotate(r2);
text("e", x2, y2);
if (loop > 200) {
x2 += random(-3, 2);
y2 += random(-2 , 3);
r2 += random(-0.5, 0.5);
if (loop >370){
loop = 0; }
}
else {
x21 = 0;
y21 =0;
r21 = 0;
float dx2 = x21 - x2;
float dy2 = y21 - y2;
float dr2 = r21 - r2;
x2 = x2 + ( dx2 * easing );
y2 = y2 + ( dy2 * easing );
r2 = r2 + ( dr2 * easing );
}
popMatrix();
}