CSC103 Homework 5 2012

From dftwiki3
Revision as of 17:03, 29 February 2012 by Thiebaut (talk | contribs) (Processing Sketch)
Jump to: navigation, search

--D. Thiebaut 16:55, 29 February 2012 (EST)



This homework is due on March 7th, 2012, at 9:00 a.m. in class. You can (and are encouraged) to work on this homework in pairs. If you work in pairs, you must find time to work together, and not allow one person to work on the program on his or her own.

Processing Sketch



  • Run the video above. This is what your sketch needs to do.

Requirements

  • Your sketch must generate the rectangles that we see in the back of the sketch.
  • The rectangles must touch
  • The rectangles must be of varying color
  • The number of rectangles is up to you. At least 10.
  • Your sketch must display two columns of circles.
  • The circles should fit inside the rectangles. They can be smaller than the width of the rectangles
  • The circles can be of any color you want, but not the same color as the rectangle underneath them.
  • There should be two columns of circles, one to the left, one to the right.
  • The length of the left column should be controlled by the position of the mouse.
  • Similarly for the right column of circles.
  • The left column must grow from the bottom up
  • The right column from the top down.

Hints on how to start with this sketch

Here is how I would recommend you start:

  1. generate rectangles that are stacked up one on top of the other. You know how to generate a stack of circles (from the lab), so you should be able to generate a stack of rectangle. By the way, the solutions for all the challenges from the Processing lab have been added at the bottom of the lab. Check them out!
  2. Look at the sketch where you had to change the color of the circles in the lab. Use this method to change the color of the rectangles. You do not have to make them go from green to red, as in the video. Figure out something that makes them go from one color to another. Avoid white...
  3. Then generate a column of orange circles in the middle of the window, as you did in the lab.
  4. Adjust the dimensions of the circles so that they each fall inside a rectangle.
  5. Adjust the locations of the circles so that they are close to the left of the window.
  6. Generate another column of circles and put them on the right side of the window.

Submission

  • Details of how to submit your program will be given later... stay tuned.