Warning: Use of undefined constant DATABASE_SERVER - assumed 'DATABASE_SERVER' (this will throw an Error in a future version of PHP) in /nfs/c05/h03/mnt/77459/domains/cmuems.com/html/2011/d/wp-config.php on line 28
CMU Electronic Media Studio II, Fall 2011, Section D » Class notes & examples (from Eric)

Max Patches 11/28

Class notes & examples (from Eric) — EricSinger @ 9:50 pm

Download here

Processing examples for 9/14

Class notes & examples (from Eric) — EricSinger @ 10:22 pm

Today’s in-class code can be found here.

Processing examples for 9/12

Class notes & examples (from Eric) — EricSinger @ 1:04 am

Processing examples for 9/12 can be found here.

Class Sept 12/14

Class notes & examples (from Eric) — EricSinger @ 1:05 am

What we’ll go over:
– questions on homework (now due Wed)
– explanation of translate and scale
– subroutines explained more fully (in, out args)
– more about variables (types, final, static, arrays)
– input: mouse, keyboard, audio, time/date

Processing examples for 9/7

Class notes & examples (from Eric) — EricSinger @ 4:48 pm

You’ll find today’s example code files here.

Class September 7th

Class notes & examples (from Eric) — EricSinger @ 9:27 pm

Here are some notes about what we’ll be going over in class 9/7:
– print(), println()
– Loops: loop(), for, while, continue
– Conditionals: if/else, switch/case/default/break, ?:
– Relational & Logical Operators
– Creating PDFs. Tutorial link: http://www.processing.org/reference/libraries/pdf/index.html
– if there’s time, touching on Input and Output

Processing Sketch 1

Class notes & examples (from Eric) — EricSinger @ 2:45 pm
void setup() {
  // do some great setup stuff
  smooth();
  size(400, 400);
  background(192, 64, 0);
  stroke(255);
  frameRate(1);
}

void draw() {
  int randomX;
  int randomY;

  // generate random rect starting point
  randomX = int(random(400));
  randomY = int(random(400));

  // generate random rgb value
  int r = int(random(256));
  int g = int(random(256));
  int b = int(random(256));

  // draw the rect
  stroke(r, g, b);
  fill(r, g, b);
  rect(randomX, randomY, 20, 20);
}

int lastX = 200;  // last x value
int lastY = 200;  // last y value

void mousePressed() {
  // reset stroke to white
  stroke(255);

  // draw mouse line
  line(lastX, lastY, mouseX, mouseY);

  // save our last click point
  lastX = mouseX;
  lastY = mouseY;
}
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2022 CMU Electronic Media Studio II, Fall 2011, Section D | powered by WordPress with Barecity