Computer Graphics
Fall 2021
You will be adding interactive funcionality to the sierspinski gasket program:
Your program will modify the existing sierpinski gasket triangle code to allow for the following interactions:
You will need four buttons:
All buttons will appear on one line and in the aforementioned order. The animation should NOT start when the page loads. If the animation is not running, Start/Stop will begin the animation at a default rate of 1 animation frame per 250 milliseconds. If the animation is running Start/Stop will stop or pause the animation. Reset will restart the animation from the beginning at the default rate. Pressing the Slow Down button while the animation is running will cause the animation rate to decrease by one fifth. Pressing the Speed Up button will cause the animation rate to increase by one fifth. The speed will be capped at a rate of 1 animation frame per millisecond. Pressing the increase of decrease speed while the animation is not running will leave the animation paused, but still modify the rate of animation when it is resumed.
requestAnimFrame
to call a function repeatedly (check the Chapter 3). When you find it, you will also need to find a way to stop it (Google will help).You will earn up to 20 points for this exercise, broken down as follows: