
This week’s assignment focuses on some programming techniques in Processing. Some of you have already created or used Classes in your programs, represented as additional tabs in your Processing sketch. (My latter Weather Example Code used a Class called “Agent” to create and draw many moving red boxes.) For this assignment Classes (and Objects) are a requirement. If you’re still not comfortable with Classes and Objects please read the Processing.org Tutorial on Objects. And don’t hesitate to email me with questions.
Homework Assignment
Your mission should you choose to [you must] accept it, is to download the following demonstration code and uncover the mystery phrase hidden within: imagesAsData.zip
The above code demonstrates how to load images in Processing and use each pixel’s RGB values to drive a visualization. Or rather, it nearly does. You must complete the code by using the mystery image’s RGB values as X, Y, Z coordinate data. But which color values correspond to which axis? You’ll know you’ve hit upon the correct combination when you see a two-word phrase constructed from the blocks flying through 3D space. But in order to find this phrase you may have to pan, zoom, and spin around the 3D space. How? I’ve added PeasyCam to this code package. See their website (http://mrfeinberg.com/peasycam) for instructions on how to fly through the space using your mouse.
Your Objectives
1. For next Thursday you must replace the image of Mr. Rogers with an image of your choosing. It must be the same pixel dimensions, 48 × 48.
2. You must correctly identify the two-word mystery phrase that will appear only after you’ve hooked up the mystery image’s RGB data to X, Y, Z values for the pixel agents. The second word is one often uttered by Mr. Rogers. The first is somehow related to the visual environment you are playing in.
3. Look through Aaron Koblin’s work at http://aaronkoblin.com/work.html and write a short response on your blog. Do you find his pieces effective? What might you change if it were your project? Which ones are your favorites?
4. Craft a similar response on your blog for Karsten Schmidt (aka Toxi) at http://postspectacular.com. How would you compare Toxi to Koblin? How are they similar? Different? What descriptive phrase does Karsten use to describe his occupation?
Takeaways
After completing this mission you’ll be able to load images in Processing, use the pixel’s RGB values as data, use Classes and Objects to make your programs more robust, and have the experience of investigating data visually. Bonus: this sample code allows you to save out time-stamped frames, record a series of frames for making a movie later, and pause the animation. (Open the code and search for “keyPressed()” to see the key commands.)
Good luck!
Tags: 3D, Agents, arrayList, box, loadImage, loadPixels, Objects, OpenGL, Paths, PImage, RGB