# Category Archives: 22-animatedgif

## 14 Feb 2015

This is only funny when you realize that I’ve subconsciously taken design cues from the popular app “aa”, a game that one of my friends has been playing obsessively, while I stare on, jealous at their perfect procrastination methods. ok, maddy out

```int slices = 24;
float pos = 0;
//-----------------------------------------------------------
float tCos;
float tSin;
//-----------------------------------------------------------
float midX;
float midY;

void setup() {
size(400, 400);
noStroke();
smooth();
}

void draw() {
float tCos = (sin(millis() / 100) + 1);
float tSin = (cos(millis() / 100) + 1);
//---------------------------------------------------------
float y = tSin * 20;
float x = tCos * 20;
//---------------------------------------------------------
background(128);
pushMatrix();
translate(height/2, width/2);
rotate(PI/3* (millis() / 100));
for (int i = 0; i < slices; i++) {
if (i % 2 == 1) { pos = x; }
else { pos = y; }
// stems
stroke(0);
line(0, 0, 0, pos + (rad*2) + 40);
noStroke();
// ellipse
fill(255/slices * i);
rotate(PI/slices*2);
}
popMatrix();

pushMatrix();
rotate(PI/3* (millis() / 100));
for (int i = 0; i < slices; i++) {
if (i % 2 == 1) { pos = x; }
else { pos = y; }
// stems
stroke(0);
line(0, 0, 0, pos + (rad*2) + 40);
noStroke();
// ellipse
fill(255/slices * i);
rotate(PI/slices*2);
}
popMatrix();

pushMatrix();
translate(height, width);
rotate(PI/3* (millis() / 100));
for (int i = 0; i < slices; i++) {
if (i % 2 == 1) { pos = x; }
else { pos = y; }
// stems
stroke(0);
line(0, 0, 0, pos + (rad*2) + 40);
noStroke();
// ellipse
fill(255/slices * i);
rotate(PI/slices*2);
}
popMatrix();

pushMatrix();
translate(0, height);
rotate(PI/3* (millis() / 100));
for (int i = 0; i < slices; i++) {
if (i % 2 == 1) { pos = x; }
else { pos = y; }
// stems
stroke(0);
line(0, 0, 0, pos + (rad*2) + 40);
noStroke();
// ellipse
fill(255/slices * i);
rotate(PI/slices*2);
}
popMatrix();

pushMatrix();
translate(height, 0);
rotate(PI/3* (millis() / 100));
for (int i = 0; i < slices; i++) {
if (i % 2 == 1) { pos = x; }
else { pos = y; }
// stems
stroke(0);
line(0, 0, 0, pos + (rad*2) + 40);
noStroke();
// ellipse
fill(255/slices * i);
rotate(PI/slices*2);
}
popMatrix();
}```

# mileshiroo

## 10 Feb 2015

Many WikiHow tutorials include illustrations to accompany the text. I found an illustration of a man on the article “How to Tell Someone to Stop Flirting With You” that I thought would be suitable to animate. I animated many instances of this man at two scales to create a multiplicity of men. The scene is at once relaxing and monotonous. The man’s expression suggests intense focus, even passion. A reinforcing feedback loop only strengthens his commitment to the task at hand.

```PImage man;
PVector manSize;
float ang = 0;
int numMediumMen = 30;
int numBigMen = 35;
PImage[] mediumMen = new PImage[numMediumMen];
PImage[] bigMen = new PImage[numBigMen];
PVector[] smallMenPos = new PVector[numSmallMen];
PVector[] mediumMenPos = new PVector[numMediumMen];
PVector[] bigMenPos = new PVector[numBigMen];
float[] smallMenVel = new float[numSmallMen];
float[] mediumMenVel = new float[numMediumMen];
float[] bigMenVel = new float[numBigMen];

void initializeMen() {
int startX = -100;

for(int j = 0; j < numMediumMen; j++) {
int y = height/5 + (int)random(80);
int x = j * (int)manSize.x + startX;
mediumMenPos[j] = new PVector(x,y);
mediumMenVel[j] = random(-j/2,j/2);
}

for(int k = 0; k < numBigMen; k++) {
int y = -width/10 + (int)random(80);
int x = k * (int)manSize.x + startX*6;
bigMen[k].resize((int)manSize.x*6,(int)manSize.y*6);
bigMenPos[k] = new PVector(x,y);
bigMenVel[k] = random(-k/5,k/5);
}
}

void setup() {
size(1500, 1500);
manSize = new PVector(man.width/2,man.height/2);
initializeMen();
}

void draw() {
if(frameCount > 12) noLoop();
saveFrame();
ang += TWO_PI/10.0;
background(255);
tint(255,180);

translate(-300,0);
for(int k = numBigMen - 1; k >= 0; k--) {
image(bigMen[k],bigMenPos[k].x,bigMenPos[k].y);
bigMenPos[k].y += bigMenVel[k]*sin(ang);
}

tint(255);
for(int j = numMediumMen - 1; j >= 0; j--) {
float pulseAmt = float(j)/float(numMediumMen)*.15;
mediumMenPos[j].y += mediumMenVel[j]*sin(ang);
mediumMenPos[j].x += mediumMenVel[j]*sin(ang);
image(mediumMen[j],mediumMenPos[j].x,mediumMenPos[j].y,mediumMen[j].width*((sin(ang)*pulseAmt)+.95),mediumMen[j].height*((sin(ang)*pulseAmt)+1.5));

}
}
```

# Zach Rispoli

## 10 Feb 2015

These are geodesic kaleidoscopes made out of motion capture markers. The idea here is that both a human and a machine trained to recognize these markers using computer vision would be equally disoriented by viewing them.

Here are three of them:

See the rest of the kaleidoscopes here! (There are a lot more)

# Lenticular Animation: Flowing circles

I was inspired for this design by caustics. I had made something similar in a previous semester so I piggy-backed off of that code, but remade it so that it flowed using sine waves rather than with noise. I also made it loop. I feel that I could have worked much longer on the different ways of making the circles scale, but I am nonetheless pleased with my results. For me it has a calming feel. The thing I feel I failed most at with this project was time consumption. I spent a long time trying to figure out some intricate system to animate, when in the end I wound up going with something simple. This is mostly because I fell back to researching, and I looked at the Bees and Bombs website. The interesting animations with simple geometry were very impressive, and it reminded me of a (less impressive than theirs) work that I had done which may be adaptable.

```/////////////////////////
// Flowing
// Author: Matt Kellogg
// Created: September 22, 2014
// Edited: February 10, 2015 added saving images and use of sin wave
/////////////////////////

//declare globals/constants
var backgroundColor, diam;
var img;
var counter;
var SAVE_IMAGE = false;

function setup() {
createCanvas(1500,1500);
img = createGraphics(1500,1500);
// Similar to additive color blending which wasn't working
img.blendMode(DODGE);
// a deep red
backgroundColor = color(125,20,20);
diam = 90.0;
counter = 0;
if (SAVE_IMAGE){
for (counter = 0; counter< 10; counter++){
drawImage(counter);
save(img, "gif-image-"+counter+".png");
}
}
}

function drawImage(counter){
//declare variables so they aren't re-instantiated per loop
var r, b, d, x2, y2, x, y, xDif;
// The distance to the next circle at the same height
img.blendMode(NORMAL);
img.background(backgroundColor);
img.blendMode(DODGE);
img.noStroke();
for (x = -diam; x < width+diam; x+=xDif)
{
for (y = -diam; y < height+ diam; y+= diam)
{
//for each position draw a two circles
// the second is down and to the right
// so that all the circles will be tangent
// without the size variation

// map red and blue values to x and y positions
r = map(x, 0, width, 50, 120);
b = map(y, 0, height, 50, 120);
img.fill(r,100,b);
// generate noise for the first diameter based on
// the position and the frameCount
d = diam*(1.0+Math.sin((x+y+counter*2)*0.314))/2.0;//(Math.sin(y*frameCount*0.1)+Math.cos(x*frameCount*0.1))*diam;//noise(x*0.1, y*0.1, frameCount*0.01)*diam - diam/3.0;
img.ellipse(x, y, diam+d, diam+d);

// calculate the position for the second circle
// get the red and blue
r = map(x, 0, width, 50, 120);
b = map(y, 0, height, 50, 120);
img.fill(r,100,b);
// make some noise
d = diam*(1.0+Math.sin((x2+y2+counter*2)*0.314))/2.0;//(Math.sin(y*frameCount*0.1)+Math.cos(x*frameCount*0.1))*diam;//noise(x*0.1, y*0.1, frameCount*0.01)*diam-diam/3.0;
img.ellipse(x2, y2, diam+d, diam+d);
}
}
}

function draw() {
drawImage(frameCount/2);
background(0);
image(img,0,0);
}
```

# jackkoo

## 10 Feb 2015

Click on it to see animation. A bunch of zigzags stacked together to create a living creature.

This particle shape was sort of made by accident. I initially wanted it to pulse outwards like this.

However I was playing with the array loop variables and notices that if I made their number of iteration increase through the array loop, they stack up and create a living looking creature. I decided I really like it and also wanted to show the structure. Therefore I made the top one as well so you can see each individual part, and then can imagine how the bottom one was made much easily.

```ArrayList<Tentacle> tentacles = new ArrayList<Tentacle>();
ArrayList<Zigzag> zigzags = new ArrayList<Zigzag>();

ArrayList<Tentacle> tentacles2 = new ArrayList<Tentacle>();
ArrayList<Zigzag> zigzags2 = new ArrayList<Zigzag>();

int numberOfTentacles = 20;
int numberOfTentacles2 = 8;

int frame = 0;

boolean a=false;

boolean b=false;
void setup()
{
for (int i = 0; i < numberOfTentacles; i++) {
Zigzag zigzag = new Zigzag
(
new Vec2(260, 250), // position
2 * i, // segments
new Vec2(10 +0.1 *i , 80 + 0.1 *i) // size
);

}

for (int i = 0; i < numberOfTentacles; i++){
Tentacle tentacle = new Tentacle(100, 100, zigzags.get(i).points);
}

for (int i = 0; i < numberOfTentacles2; i++) {
Zigzag zigzag = new Zigzag
(
new Vec2(260, 150 -(i*20)), // position
4 * i, // segments
new Vec2(10 , 80 ) // size
);

}

for (int i = 0; i < numberOfTentacles2; i++){
Tentacle tentacle = new Tentacle(100, 100, zigzags2.get(i).points);
}

size(500, 500);
frameRate(60);
}

void draw(){

background(20,30,40);
for (int i = 0; i < numberOfTentacles; i++){
tentacles.get(i).update();
}

for (int i = 0; i < numberOfTentacles2; i++){
tentacles2.get(i).update();
}

if(a){
if(b){
saveFrame("picture"+frame+".png");
frame++;
}
b=!b;
}
a = !a;

if(frame > 60){
noLoop();
}
}

class Joint{
Vec2 p1;
Vec2 p2;
Vec2 distance;

float woo;

float easeValue;
boolean easeDirection;

int numberOfJoints;
Joint nextJoint;

Joint (Vec2 p1, Vec2 p2, boolean easeDirection)
{
// create the center point
this.p1 = new Vec2(p1.x,p1.y);

// create the perimeter point, pointed up
this.p2 = new Vec2(p2.x, p2.y);

distance = new Vec2
(
abs(p1.x-p2.x),
abs(p1.y-p2.y)
);

this.easeValue = 0;
this.easeDirection = easeDirection;

woo = 2*PI/120;
}

void rotateJoint(float angle){
if(easeValue > 2*PI){
easeValue=0;
}

if(!easeDirection){
angle *= -1;
}
easeValue += woo;

float easeAngle = easeValue * angle;

//easeAngle = angle;
float s = sin(easeAngle);
float c = cos(easeAngle);

p2.x -= p1.x;
p2.y -= p1.y;

// rotate point
float xnew = distance.x * c - distance.y * s;
float ynew = distance.x * s + distance.y * c;

// translate point back:
p2.x = xnew + p1.x;
p2.y = ynew + p1.y;
}
}

class Tentacle {
float x;
float y;
ArrayList<Joint> joints = new ArrayList<Joint>();

Tentacle (float x, float y, ArrayList<Vec2> points){
this.x = x;
this.y = y;

boolean isLeft = false;

for (int i = 0; i < points.size()-1; i++){
Joint joint = new Joint
(
new Vec2(points.get(i+1).x, points.get(i+1).y),
new Vec2(points.get(i).x , points.get(i).y),
isLeft
);

isLeft = !isLeft;
}
}

void update(){

for(int i = 0; i < joints.size()-1; i++){
Joint joint = joints.get(i+1);
Joint jointNext = joints.get(i);
noFill();

jointNext.p1.x = joint.p2.x;
jointNext.p1.y = joint.p2.y;

strokeWeight(1);
stroke(255,255,255,60);
line
(
joint.p1.x,
joint.p1.y,
joint.p2.x,
joint.p2.y
);

strokeWeight(i/2);
stroke(joint.p1.x, joint.p1.x*i, 30, 20);
float ellipseSize = i/1 * 1.1;
ellipse(joint.p1.x, joint.p1.y, ellipseSize, ellipseSize);
joint.rotateJoint(1);

//ellipse(joint.p2.x, joint.p2.y, 10,10);
}
}
}

class Vec2{
float x;
float y;

Vec2 (float x, float y)
{
this.x = x;
this.y = y;
}
}

class Zigzag{
ArrayList<Vec2> points = new ArrayList<Vec2>();

Zigzag(Vec2 position, int numberOfSegments, Vec2 segmentSize){
// Create a uniform zigzag
for (int i = 0; i < numberOfSegments; i++){
Vec2 vec2 = new Vec2(position.x, position.y + segmentSize.y * PennerEaseOutSine((float)i/numberOfSegments));

// Change zigzag direction

}

// Create the zigzag
for (int i = 0; i < points.size(); i++){
points.get(i).x += segmentSize.x * PennerEaseInSine((float)i/numberOfSegments);
segmentSize.x*=-1;
}
}

void render(){
noFill();
beginShape();

for (int i = 0; i < points.size(); i++){
strokeWeight(i/4);
stroke(i*25,i*35,0);
float ellipseSize = i/1 * 1.1;
ellipse(points.get(i).x, points.get(i).y, ellipseSize, ellipseSize);

stroke(90,90,0);
strokeWeight(0.4);
vertex(points.get(i).x, points.get(i).y );
}

endShape();
}
}```