Skip to content
Christopher Baker edited this page Oct 5, 2013 · 12 revisions

Upcoming questions ... - What are ofPushMatrix() and ofPopMatrix() and how do they work with ofTranslate(), ofRotate() and ofScale()? - What are ofPushStyle() and ofPopStyle() and how does it work with ofSetColor() ... etc.

Due Week 7

  1. (sugested) Review Chapter 5 (object oriented programming, pointers, etc).
  2. Extend the particle system in class by doing several of the following (to meet your particular artistic goals):
    • Add a "force" other than gravity. You might consider modifying the particle's acceleration or modifying the particle's velocity directly. The force can be attractive (like a black hole) or repulsive (like oil and water). Consider only applying the force to particles whose distance is less than some threshold (see the distance calculation in the code to see how to calculate the distance between two points).
    • Add several other "constraints". The age / maxAge is a constraint that we use to remove particles if they are of a certain age. Other ideas include:
      • Creatively deal with the edges instead of letting the particles fall off the screen (and die), make the particles wrap around to the other side of the screen (like asteroids) (see this video if you don't know what I mean ... http://www.youtube.com/watch?v=cZfsnA7dAHI)
      • Or, have them bounce off of the walls (we did something like this in class)
    • Incorporate additional media (fonts, letters, images, shapes, etc)
    • At the end of each particle's life, cause new particles to be spawned from the location where the old particle died (kind of like fireworks ...).
    • Use the particles to control something besides the visuals -- maybe use the headings of the particles to control the pitch or speed of videos or sound or Arduino output.
    • ...
  3. You must also demonstate your ability to extend the BaseParticle to create your own custom particle. See the SpecialParticle class for an example of how to do this.
  4. Please ask questions on the forum!
  5. Be able to answer the following questions from memory (or without a reference):
    • What is a class?
    • What is an object?
    • What is object-oriented programming?
    • What is a pointer?
    • What is a "shared pointer" (ofPtr is a shared pointer. What does it do? How does it differ from a "normal" pointer?)

Due Week 6

  1. Combining the assignments from this week and last, create a program system that implements bidirectional communication between the Arduino and openFrameworks. The Arduino should send (at least) three values (buttons and/or potentiometers or other sensor data) to openFrameworks where it should be displayed animated or rendered in some way -- be creative (hints: check out ofImage, ofTrueTypeFont, ofMesh, etc)! openFrameworks should simultaneously be able to send (at least) three values generated by the keyboard, mouse or other source to the Arduino (hint: Consider using the virtual buttons shown in this weeks' examples, or perhaps create your own "slider" or other controller or data stream? Also check out the serial.write() or serial.writeBytes()*). Use the three (or more) values streaming from openFrameworks to control output on the Arduino. This could be the brightness of an LED or something more exciting like a motor or a solenoid (hint: on the Arduino you will use Serial.read()). Please set up your piece of code poetry during the first 10 minutes of class next week so we can make our way around the room and check out what you've made.
  2. Be able to answer the following questions from memory (or without a reference):
    • How are numbers represented in base 2 (binary)?
    • How would you represent the decimal number 55 in binary?
    • How might you represent the number -55 in binary?
    • What are bits?
    • What are bytes?
    • What is the difference between a serial connection and a paraellel connection?
    • What are bauds?
    • What is an array?
    • How is an array different from a std::vector<>?
    • What is a "reference"?
    • What is a "pointer"?
    • What do the new and delete keywords do?
    • What are the risks of using pointers and new and delete?
    • What are the alternatives to new and delete?

*To use ofSerial::writeBytes() consider the following example:

// in void setup()
ofSerial mySerial;
mySerial.setup(); // fill in your data

// ...

// in void update()

ofBuffer outputBuffer;

outputBuffer.append(ofToString(VALUE_0));
outputBuffer.append(",");
outputBuffer.append(ofToString(VALUE_1));
outputBuffer.append(",");
outputBuffer.append(ofToString(VALUE_2));
outputBuffer.append("\r\n");

int numBytesWritten = mySerial.writeBytes(outputBuffer.getBinaryBuffer(), outputBuffer.size());

if(numBytesWritten != outputBuffer.size())
{
    // warning ... something probably went wrong ...
}

// You will then READ the values in a similar way on the arduino using Serial.read();
// Consider this approach:
// http://stackoverflow.com/questions/11068450/arduino-c-language-parsing-string-with-delimiter-input-through-serial-interfa

Due Week 5

  1. Do the std::vector tutorial here.
  2. Expand our in-class demonstration to animate the incoming potentiometer data.
    • Ideas: rotate the hands on a clock, rotate an image, etc.
  3. Expand our in-class demonstration to send the state of 2 potentiometers from Arduino to openFrameworks.
    • Hints: I recommend sending your values from Arduino in the following format: VALUE1,VALUE2\r\n. To do this you'll do: Serial.print(VALUE1); Serial.print(","); Serial.println(VALUE2); Then on the openFrameworks side, everything will look the same but you will SPLIT the string at the comma using ofSplitString (you'll need to do the std::vector tutorial for this!) and extract the text of the two numbers, which you will then convert to integers using ofToInt.
    • Ideas: make an etch-a-sketch, manipulate the y/z rotation of an image, control frequency and pitch of a tone.
  4. Draw a block of 256 vertical lines right next to each other using a for loop.
    1. Make all of the odd lines red and all of even lines yellow. (hint: use and if statement and the modulo operator %)
    2. Change the color of those lines to form a gradient, with the first line white and the last line black.
    3. (Bonus) Produce the same visual output (the gradient) without a for loop. (hint: Consider using ofMesh or ofVboMesh)
  5. Be able to answer the following questions from memory:
    • What is a vector?
    • What is does an 'if' - 'else' - statement do?
    • What does a 'switch' statement do?
    • What does a for loop do and how does it differ from a while loop?
    • What is a modulo operator and how do you use it?

Due Week 4

  1. Read Chapters 4, 5, 8 in Programming Interactivity
  2. Program an Arduino to blink the message What hath God wrought in American International Morse Code on an LED. Use one variable to control the length of the dits and and one variable to control the length of the dahs. Do not "hard code" any numbers in your program, except when assigning variables.
    • Place program in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/Arduino/MorseBasic
  3. Bonus Modify the Arduino program to encode any arbitrary string in morse code using the LED.
    • Place program in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/Arduino/MorseAdvanced
  4. Bonus Use the camera and openFrameworks to watch the LED, decipher the message and print it on the screen.
    • Place program in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/openFrameworks/MorseDecoder
  5. Render Sol LeWitt’s 1971 Wall Drawing for the School of the MFA Boston in openFrameworks. Save your output as a .pdf. (hint: consider ofGetWidth(), ofGetHeight(), ofRandom(), ofLine(), ofCircle(), examples/pdfExample).
    • Place program in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/openFrameworks/SolLewitt1971
    • Place pdf in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/openFrameworks/SolLewitt1971/bin/*.pdf
  6. Bonus Add the ability to generate a new (and different) rendering of the piece each time the spacebar is pressed.
    • Place program in folder ExperimentalMedia/people/YOUR_USERNAME/Week4/openFrameworks/SolLewitt1971Advanced
  7. Add all of your programs and output to your fork of our class repository and issue a pull request to me before class begins.
  8. Be able to answer the following questions from memory:
    • What do int, long, short and byte have in common? How are they different?
    • What do float and double have in common? How are they different?
    • What does the unsigned mean when used with int, long, short and byte?
    • What is the function of the void setup() function in both openFrameworks and Arduino?
    • What is the function of the void loop() in Arduino and void draw() in openFrameworks?
    • What is a preprocessor?
    • What is a compiler?
    • What is a linker?
    • What is an IDE?
    • What programming language forms the foundation of both Arduino and openFrameworks? Who invented the language and when?
  9. Remember to work together!
  10. Bring your Arduino to class.

Due Week 3

  1. Command Line Tasks (hint: learn more about command options with man - e.g. man ls)
    • Download and save this image file with curl.
    • Change the name of the image file above using mv.
    • Make a duplicate of the image file using cp.
    • List the contents of your home directory using the long form. Now do it using ~. Now do it printing each file's serial number.
    • Count the number of Presidential orders on the topic of "Fitness" in this file using curl, pipes |, wc and grep. Do it all in a single line. Confirm your answer using Excel or Google docs.
  2. Get familiar with Git / Github. Check out this brief github Bootcamp.
    • Set up git for your platform. Instructions here. While git will suggest that you "Forget the terminal. Download our native app instead.", please use the command-line version for this assignment, rather than the native app. If you hate the command line version, you're free to use the native app after this!
    • Fork our class repository (you may have already done this in class).
    • Clone your fork of our repository into YOUR_OPEN_FRAMEWORKS_ROOT/ExperimentalMedia
    • Create a folder called YOUR_OPEN_FRAMEWORKS_ROOT/ExperimentalMedia/people/YOUR_USERNAME (fill in the blanks appropriately)
    • Using nano on the command line, create a markdown file in your folder called about.md and add some information about yourself. Try out some of the markdown formatting features. Get a quick markdown tutorial here.
    • Add your new file to a change set (hint: use git add)
    • Commit your changes (hint: use `git commit -m "Your commit note here ...")
    • Push your commit(s) online to github (hint: use git push origin).
    • Once back on the github site, you should see your changes. Issue a "Pull Request" for me to merge your changes into the main repository.
    • Work together on this! Teach each other! If you get stuck, open an issue and I'll jump in.
    • Bonus: Once you see that other people's changes are showing up the the main class repository, "pull" those changes into your repository, so your repository stays synchronized with the main repository. (hint: git pull upstream master)
  3. Make sure you read chapter 6 from Programming Interactivity.
  4. Sign up for the openFrameworks forum. Browse around and see what people are up to. Perhaps consider introducing yourself.
  5. If you are an IRC user, you can usually find other openFrameworks users here.
  6. If you are a Twitter user, consider following @openframeworks and @ofxaddons.
  7. Using the tag openFrameworks find at least openFrameworks works that you find particularly interesting.
  8. Bring your Arduino to class for week 3.

Due Week 2

  1. Get Books!
    • Getting Started with Arduino, Second Edition, By Massimo Banzi
      • This is optional because Programming Interactivity covers most of it, but it’s a nice handly little guide if you want to drop an extra $5.
    • Programming Interactivity, Joshua Noble
      • This will be our main reference.
    • Note: Both books are available in DRM-free eBook/PDF form from http://oreilly.com/ Steep discounts (50%+) are available: http://www.google.com/?q=coupon+oreilly.com
  2. Read!
    • Ch. 1, 2 and 6 of Programming Interactivity
  3. Install!
  4. Sign up!
  5. Get Equipment
    • Acquire an Arduino UNO or newer ( in reality older ones with the Atmega 328 or better will be fine). Arduino UNOs are available in SAIC resale or in the vending machines. You are welcome to get a newer Arduino (like a Due), but you probably won’t need it. That said. the Leonardo is pretty rad since it can emulate USB devices like a keyboard.
  6. Do it!
    • Attempt to get openFrameworks Examples running!
Clone this wiki locally