The Task

It is the end of the semester we will not delay the due date on this assignment. This is fairly straight forward. Just follow the instructions and check off each part.

We will alter the clock from Dec 1 to have several new features. Here is the movie of clock you are do build. The features are:

  • ( 30 pts) Build the clock we had in class. Yes, you can copy the code from class for this. See web site. You just can't copy from each other.
  • ( 10 pts) Make sure the hour hand doesn't jump on the hour but moves smoothly between the hours. This is the way we designed it in class so using the code from class should get you that. The color of the clock face is 37 on the scale from 0 to 255.
  • ( 10 pts) Make sure the clock is resizable.
  • ( 10 pts) Change the width of the hour, minute, and second hands to be 4, 3, 2 pixels.
  • ( 10 pts) Change the rectangles to circles around the outside of the clock and be sure that the circles are centered on the end point of the second hand as it sweeps. We did this for rectangle so do this for circle.
  • ( 50 pts) Write a routine called

    void drawNum(float x, float y, float angle, float radius, int num, float size)
    

    that will help put the numbers on the clock face to look as it does in the movie. This is a lot like drawing tick marks but instead with text. So you'll need to invoke this procedure within a loop. This will draw the given number at the point that is at radius distance and the given angle from the point (x, y). The text will be centered around that end point in both horizontal and vertical directions. Angle for this routine should mean the same thing it does as angle does in the drawTick and drawHand routines. The size of the text will be size. The color of the number will be determined by the angle the same way as everywhere else.

  • ( 20 pts) Add numbers around the outside of the clock by calling drawNum 12 times for the numbers 1 through 12. Make the radius used for drawing a variable called numRadius and have it initialized to .82 times the radius. Make the numbers three times the hourDotSize in size.
  • ( 30 pts) Make drawHand slightly more complicated. Instead of having the hand just draw in the direction angle with a length radius it needs to do two things: draw a small line 180 degrees in the opposite direction but only 10 % of radius. That is, it has a little part in the opposite direction. See images. Also it has a circle around the origin point whose radius is twice the width of the line weight. See images. Notice that the hour hand is drawn, then the minute, and then the second so that you have a nice stacking of the circles. This is the order we did it in class.

Submission

Save your results as a .pde file and submit the file to the BBLearn page.