Graphic JavaScript


Back to index
Rotating Object

Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:

Click on the canvas area several times and observe what happens. Inspect the code to see how the triangle is rendered so that it rotates a little with each click. Be sure that you are able to answer the following questions:

  1. How many clicks does it take to produce a full rotation of the triangle?
  2. What kind of triangle is displayed?
  3. What would you do to reverse the direction which the triangle rotates?
Your assignment is to produce a square which rotates in a counter-clockwise direction.