EDPX 2100 Coding
Spring 2016
MW 9:00-11:50 Sturm 434
Dan Wilcox, Shwayder 215, danomatika.com
Email: daniel.wilcox[at]du[dot]edu
Voice: 412 980-7081
Office hours: T 2-4pm & by appointment
Syllabus
Links
Processing: processing.org
Download, reference, tutorials, etc
Pirate Pads:
Examples from class:
- Examples from Weeks 1-4 (zip)
- Examples from Weeks 5-9 (zip)
Schedule
3/21
Course intro
Brief history of interaction
Drawing exercise
Introduction to Processing
Overview of Processing as a tool
Programming and iteration
Managing expectation
Brief History on Interactivity
- ELIZA - Joseph Weizenbaum
- Ivan Sutherland - Sketchpad
- SAGE system
- Mother of All Demos - Douglas Engelbart
- Videoplace, Responsive Environment - Myron Kruger
- Steve Jobs visits Xerox Palo Alto Research Center in 1979 (dramatization)
- Colossal Adventure
- Hypercard
- Macromedia Director (How to Make a Rollover Button)
- Max/MSP Live Coding
Programming and Iteration
- Learn to think like a computer
- You must come to grips with the process of iteration: make a thing, make it better
- Programming is failure followed by success
- Don’t take it personally
- Small victories will be crucial
Homework
Download and install Processing
Read Processing book Preface & Ch. 1 (PDF)
3/23
Cancelled due to weather
Homework
Read Processing book Ch. 2-4 (PDF)
Look through Processing's built in examples and pick out a favorite to share in class.
File->Examples, open sketches, & hit the Play button to run.
3/28
Processing syntax, expressions, statements, & comments
Debugging
Sketch
Drawing shapes
point(), line()
triangle(), quad()
rect(), ellipse()
arc()
background(), fill(), stroke()
strokeWeight(), strokeCap(), strokeJoin()
curve()
bezier()
Tweak mode
Variables
Math
In class exercises
- Create a sketch with a line, rect, & ellipse
- Create lines of differing weights, fade out lines over time
- Alternate Bezier and straight lines in a continuous 5 segment line
Homework
3/30
Exercise 1 due
Shapes
beginShape(), endShape()
vertex()
curveVertex()
bezierVertex()
Conditionals
if and if else
logical operators
AND (&&), OR (||), NOT (!)
Loops
for loop
In class exercises
Pseudocode solutions for some simple problems. Take from pseudocode to Processing.
- Create a custom shape using beginShape()
- Create a sketch that draws rects but can draw circles instead when a variable is changed
- Create multiple shapes in a grid, alternating circles & ellipses
Homework
Read Processing book Ch. 5
4/04
Exercise 2 due
Planning, flowcharting, and pseudo code
Top down vs. bottom up
Using pseudo code for planning
Debugging and testing
Response
redrawing: setup & draw()
background(x, alpha)
fill() and rect
Mouse interactions
mouseX, mouseyY
pmouseX, pmouseY
mousePressed, mouseButton
Keyboard interactions
key, keyPressed, char
CODED, keyCode
UP, DOWN, LEFT, RIGHT
map()
Assign Project 1 (due 4/20)
In class exercises
- Create a simple drawing sketch using the mouse
- Create a sketch that moves an object around the screen using the keyboard
- Use map() to convert the mouse position to a new range & control the position of an object
Homework
Read Processing book Ch. 7
Processing.org tutorial: Anatomy of a Program
4/06
Images
PImage
loadImage(), image()
imageMode()
Saving images
String
Text
Tools->Create Font
Pfont, loadFont(), textFont()
text()
textSize(), textLeading(), textAlign(), textWidth()
Shape
SVG
PShape, loadShape(), shape()
In class exercises
- Load in an image and place it on display window
- Load an image with a transparent background over a background image
- Load a font & use it to place some text on the screen
Homework
Read Processing book Ch. 8
4/11
Motion
framerate
speed & direction
tweening
distance
easing
Timer
millis()
Math
random() & randomSeed()
lerp()
norm()
sin(), cos()
noise()
In class exercises
- Use the position of the mouse to have a shape follow it
- Use a timestamp to control periodic movement
- Use sin(), cos(), or noise() to make the ellipse move in a periodic manner
Homework
Read Processing book Ch. 9
Prepare Project 1 prototype
4/13
Project 1 prototypes due
Math continued
norm()
sin(), cos()
noise()
Functions
parameters
returning values
overloading
Event handlers
mousePressed(), mouseReleased()
keyPressed(), keyReleased()
In class exercises
- Write a function to use with a for loop to put ellipses randomly on the screen given a number argument
- Create a version that will draw different shapes based on a passed parameter. Overload the function to allow for either type of function call.
- Use a mouse or key event function to control your sketch.
Homework
Read Processing book Ch. 11
4/18
Arrays
Work on projects
4/20
Work day
Individual meetings in class
4/25: Project 1
Project 1 due
Project 1
Homework
Read Processing book Ch. 7
4/27
Transformations
Matrix manipulation
translate(), rotate(), scale()
pushMatrix(), popMatrix()
Homework
Processing.org tutorial: 2D Transformations
Read Processing book Ch. 10
5/02
Exercise 3 due
Assign Project 2 (due on 5/28)
Classes and object oriented programming
Objects
class
constructors
instances
methods
fields
separate files (aka Tabs)
automatic inclusion
Homework
Processing.org tutorial: Objects
5/04
ArrayList
Objects continued
classes within classes
class inheritance
Homework
Read Processing book Ch. 12
5/09
Exercise 4 due
File import and export
Images
SVG
OBJ
Text Files
CSV
XML
JSON
Useful Tutorial by Daniel Shiffman: Data
Homework
Till Nagel online tutorial: Processing RSS feeds
5/11
Libraries
Interface libraries
ControlP5
Sound
Homework
Prepare Project 2 concept
5/16
Exercise 5 due
Project 2 concept due
Planning larger projects
Simple Games
Structuring for games
Game State Examples:
- GameState (zip): simple game state control using a variable
- GameStateObjects (zip): more advanced game state control using state classes
Working Game Examples:
- BreakoutStarter - Leamon Andres (zip): a classic Breakout clone with simple game state control (also on openprocessing)
- asteroids_v2 - Lambert Wang (zip): an advanced Asterioids clones using multiple game states & classes (also on openprocessing.org)
Homework
5/18
Vectors
Vector Maths - Unity Official Tutorials
Gravity (zip): gravity simulation using PVectors for position, velocity, & acceleration
Bounding boxes
Creating interfaces in Processing
3d space
Working in 3d
5/23
Work day
Individual meetings in class
5/25
Work day
Individual meetings in class
5/28: Project 2
S 10:00-11:50 Sturm 434
Final critique (may take an extra ~30-45 mins)
Project 2 due