CS 151 Information Technology Spring 2019 

Simple Animation in Processing

Processing allows one to create a simple animation.

Example Animation



Processing Code


// Simple scrolling text

int x = 0;

// stuff that happens once at program start
void setup() {
  size(600,600);
}

// Happens 30 times every second!
void draw() {
  background(200,255,225);
  //rect(x,300,20,20);
  textSize(36);
  fill(0);
  text("Hello, World!", x, 300);
  text("Hello, World!", x-600, 300);
  // left hand side of = is a location
  // right hand side is a value;
  x = x + 2; // increment x by 1
  if (x >= 600) x = 0; // reset x to 0 if it is too large
}

Project

Animate your face from project 1 to do something entertaining that will impress your friends!

Deliverables

Send me your .pde file.

References

  1. Getting Started with Processing
  2. Processing Overview
  3. Coordinate System and Shapes in Processing
  4. Examples from Daniel Shiffman's book Learning Processing


Copyright © 2019, David A. Reimann. All rights reserved.