CSC 195 2014S, Class 03: Processing (1)
=======================================

_Overview_

* Preliminaries.
    * Admin.
    * Questions.
* Explorations with PsAiF/R
    * Sam makes fun of GitHub behavior
    * We look at a few solutions
    * We consider your problems
    * Other issues
* Processing
    * Processing: A bit of background.
    * Why Processing?
    * Processing basics.
    * Examples.
* Lab.

Preliminaries
-------------

### Admin

* Yes, there were some interesting Git issues again, mostly because I 
  forgot to give folks permission to access the archive.
* I have handouts about my summer research.  (Slides from my talk are
  outside my office.)
* Assignments:
    * Assignment 3: Getting Started with Processing.
    * Read a little about Postscript.

### Questions

PsAiF/R
-------

### GitHub and HW2 

* Don't commit your backup files.
* Don't make a recursive repo.

### PsAiF/R: Your Answers

* AS14's were very nice.

### PsAiF/R: Your Problems

* TB17's examples was very nice.

### PsAiF/R: Your Reflections

* Sam's coder was not necessarily competent because Sam is not necessarily
  competent.  Anyway, (makefun 'x) doesn't work in the definitions pane and
  Sam is too lazy to figure out why.
    * Write to Sam when you have problems.
* Some cool examples.
    * Many cool examples use values outside the range [-1 .. 1]. 
      Can we achieve similar results staying within that range?
* Does anyone have a better name?

Processing
----------

### A bit of background

* Programming language for artists, designed at MIT Media Lab
* General model: Time-based images
* Language model: Java, but friendlier
* Incredibly popular - Huge community of sharing (really ugly code)

### Why Processing?

* Might use for implementationa
* Think more about models of making images
   * What can we steal and make functional
* Think about community
* Fun!

### Processing basics

* /glimmer/processing/processing
* Two basic functions:
    * `setup()` - size(width,height); also set state/globals
    * `draw()` - redraw the image
* Stateful: Set the state and then draw things
    * `stroke(BW)`, `stroke(R,G,B)`
    * `line(x0,y0,x1,y1)`
    * `fill(BW)`, `fill(R,G,B)`
    * `ellipse(x,y,width,height)`, `rect(x,y,width,height)`

### A quick and ugly example

    float foo;
    float bar;
    float c;
    
    int width = 500;
    int height = 300;
    
    void
    setup()
    {
      size(width,height);
      foo = 300;
      bar = 300;
      c = 0;
    }
    void
    draw()
    {
      foo = (foo + 5) % width;
      bar = (bar - 2) % height;
      c = (c+1) % 93;
      colorMode(HSB,100);
      fill(c,100,100);
       strokeWeight(2);
      stroke(c,100,100);
      line(0,0,foo,bar);
      line(50,50, 50,500);
      ellipse(200,200,200,50);
      rect(200,200,200,50);
     
    } // draw
    
Lab
---

Your turn to play.
