Computer Grafik

A rotating square

Part 4
A Rotating Square

Oops ... your browser doesn't support the HTML5 canvas element

A rotating square.

  • Add a second triangle to the previous part such that you have a quadrilateral (which is maybe even a square). [Angel 2.4]
  • Center your quad (short form of quadrilateral) and rotate it such that it has its vertices on the coordinate axes.
  • Add a rotation so the quad rotates around its center. Animate the rotation angle over time. Use requestAnimFrame to continuously call your render function. [Angel 3.1]