You are not allowed to do AttachFile on this page. Login and try again.

    Assignment2Discussion

Assignment 2 FAQ and Student Discussion Page

The course staff will post answers to frequently asked questions about assignment 2 here. Feel free to add to this page yourself if you've got information to share with the rest of the class. Remember, the quickest way to get a response from a TA is to post to cs148-win0607-staff@lists.stanford.edu

Return to the Assignment 2 page.

Q1: Does my second hand need to be visible above the blue gear?

Yes, please make the second and minute hands visible during all points in their roation.

Q2: What are the units of rotation in the STTransform class?

Just like OpenGL, the rotations are specified in units of degrees.

Q3: Why do I get the "libst - Executable for Debugging Session" dialogue box when I try to build and run the assignment2 solution?

You need to set the clock project as your "startup project" in the visual studio solution. The easiest way to do this is to right click the project in the solution explorer and select "set as startup project"

Notes on keeping your clock ticking at the correct rate

Although we probably won't put a lot of emphasis on this when grading assignment 2, you should think about the following to correctly get your clock to tick at an accurate rate:

You cannot assume that 1000/framesPerSecond millis occurs between the start of each timer event. This is just a rough estimate from the number of timer events you'll get in a second. Setting a timer event tells glut to not call your event handler until at least this amount of time has passed, there aren't any guarantees about the exactness of the actual delay. Additionally, there is also time that elapses while executing your code before the next timer event is scheduled. All these factors means that basing your clock's rotation based on timer events is fairly inaccurate.

What you want to do is base rotation on elapsed wall clock time since the start of your application. The STTimer class provides you the means to check how many millis have elapsed since a designated start point. This is a reliable way to determine how much you should rotate the gears between frames.

Kayvon

Recent