farcar – Scope

Original Image              

Animated GIF              

Description              

The motivation for this design was seeing a small ghost sticker on someone’s laptop (I think it was Golan’s). I first drew the ghost as an arc, and added triangles for the bottom portion. To make things easier, I pushed the origin to the center so that all the objects would be aligned to the center of the canvas. The eyes are 2 lines, and the headphones are composed two ellipses with a stroke-only arc stretching across. To make the ghost dance, I individually sent parameters for each shape to squash for the first half of the frameCount, and stretch back out for the remaining half. By animating all the objects separately, I was able to get a more fluent motion as opposed to simply squishing the canvas as one.

Code              

//-------------------------------------------------------------------------------------
Special thanks to Golan Levin for providing the template for producing the Zoetrope PDF
//-------------------------------------------------------------------------------------
 
void drawArtFrame (int whichFrame) { 
  // Draw the artwork for a generic frame of the Zoetrope, 
  // given the framenumber (whichFrame) out of nFrames.
 
  // Draw the frame number 
  int k = abs(5-whichFrame);
  int s = k*k*(3-2*k);
  s /= -10;
  fill(0);
  strokeWeight(3);
  stroke(255);
  triangle(0+0.5*s,50,-25-0.5*s,50,-12.5,85-0.5*s);
  triangle(-12.5-0.5*s,50,12.5+0.5*s,50,0,85-0.5*s);
  triangle(0-0.5,50,25+0.5*s,50,12.5,85-0.5*s);
  arc(0,50,50+s,50-s,-3.95,0.75,OPEN);
  ellipse(-25-0.3*s,50,10,15);
  ellipse(25+0.3*s,50,10,15);
  stroke(0);
  noFill();
  arc(0,50,55+0.6*s,55-0.7*s,-PI,0,OPEN);
  stroke(255);
  strokeWeight(5);
  line(-7,40+0.3*s,-7,50-0.3*s);
  line(7,40+0.3*s,7,50-0.3*s);
}