GMU:Processing im Park/Part1: Difference between revisions

From Medien Wiki
(link to animated park sketch)
(links to processing sketches on github)
Line 75: Line 75:
[[Image:processing-im-park-screenshot-1.png]]
[[Image:processing-im-park-screenshot-1.png]]


Here's the source:
Here's the source: [https://github.com/bitcraftlab/Processing-im-Park/blob/master/lecture-01/park_grid/park_grid.pde park_grid.pde]
 
----
 
<source lang="java">
 
// Pick the size of the canvas
 
size(300, 300);
 
// Let's load all the images from our sketchfolder
 
PImage image1 = loadImage("park_001.jpg");
PImage image2 = loadImage("park_002.jpg");
PImage image3 = loadImage("park_003.jpg");
 
PImage image4 = loadImage("park_004.jpg");
PImage image5 = loadImage("park_005.jpg");
PImage image6 = loadImage("park_006.jpg");
 
PImage image7 = loadImage("park_007.jpg");
PImage image8 = loadImage("park_008.jpg");
PImage image9 = loadImage("park_009.jpg");
 
// Display the images in a 3 by 3 grid
 
image(image1, 0, 0, 100, 100);
image(image2, 100, 0, 100, 100);
image(image3, 200, 0, 100, 100);
 
image(image4, 0, 100, 100, 100);
image(image5, 100, 100, 100, 100);
image(image6, 200, 100, 100, 100);
 
image(image7, 0, 200, 100, 100);
image(image8, 100, 200, 100, 100);
image(image9, 200, 200, 100, 100);
 
// Save a screen shot to the sketch folder
 
saveFrame("park_grid.jpg");
 
</source>
 
----


=== ''Interactive Park'' Sketch ===
=== ''Interactive Park'' Sketch ===
Line 134: Line 90:
[[Image:processing-im-park-screenshot-2-anim.gif]]
[[Image:processing-im-park-screenshot-2-anim.gif]]


Here's the source:
Here's the source: [https://github.com/bitcraftlab/Processing-im-Park/blob/master/lecture-01/interactive_park/interactive_park.pde interactive_park.pde]
 
----  
<source lang="java">
 
PImage grid;
PImage tree;
 
void setup() {
  size(300, 300);
  background(0, 0, 0);
  grid = loadImage("park_grid.jpg");
  tree = loadImage("park_010.jpg");
  frameRate(5);
}
 
void draw() {
 
  if (frameCount % 2 == 1) {
    // show grid for odd frames
    image(grid, 0, 0);
  } else {
    // show tree for even frames
    image(tree, 0, 0, 300, 300);
  }
 
}
</source>


----
=== Homework 1 ===
=== Homework 1 ===


Line 174: Line 102:


Solution to the homework in progressive steps of abstraction:
Solution to the homework in progressive steps of abstraction:
* [https://github.com/bitcraftlab/Processing-im-Park/blob/master/lecture-02/animated_park_1/animated_park_1.pde Animated Park 1]
* [https://github.com/bitcraftlab/Processing-im-Park/blob/master/lecture-02/animated_park_1/animated_park_1.pde animated_park_1.pde]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_2/animated_park_2.pde Animated Park 2]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_2/animated_park_2.pde animated_park_2.pde]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_3/animated_park_3.pde Animated Park 3]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_3/animated_park_3.pde animated_park_3.pde]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_4/animated_park_4.pde Animated Park 4]
* [https://github.com/bitcraftlab/Processing-im-Park/tree/master/lecture-02/animated_park_4/animated_park_4.pde animated_park_4.pde]


== Cut-Ups, Pixels, Stripes, Collages ==
== Cut-Ups, Pixels, Stripes, Collages ==