UNB/ CS/ David Bremner/ teaching/ cs4735/ milestones/ CS4735 Lab 3




Use the setTimeout function to turn your loop in Q1 and Q2 into a chain of callbacks. Call your answer Q3.{js,html,txt}. Your cube should complete exactly 5 revolutions, each revolution taking 2 seconds. The motion should look like this video. Start with 30 steps in a single rotation, and increase the number of steps until the motion is smooth and tear free. Approximately what "frame rate" is achievable?


Replace the drawing of a single cube at each step of the animation with the gear from Q1, i.e. animate a spinning gear. Approximately what frame rate is achievable? How could drawing the gear be made faster? You don't have to impliment it, just speculate. Save your answer in Q4.{js,html,txt}