Task 3: Transforms (10 pts)

Relevant lecture: 4

Implement the three transforms in the transforms.cpp file according to the SVG spec. The matrices are 3x3 because they operate in homogeneous coordinates – you can see how they will be used on instances of Vector2D by looking at the way the * operator is overloaded in the same file.

Once you’ve implemented these transforms, svg/transforms/robot.svg should render correctly, as follows:

Robot.

For convenience, here is a list of functions in transforms.cpp you will need to modify:

  1. translate
  2. scale
  3. rotate

Extra Credit: Add an extra feature to the GUI. For example, you could make two unused keys to rotate the viewport. Save an example image to demonstrate your feature, and write about how you modified the SVG to NDC and NDC to screen-space matrix stack to implement it.

For Your Write-Up: Task 3

  • Create an updated version of svg/transforms/robot.svg with cubeman doing something more interesting, like waving or running. Feel free to change his colors or proportions to suit your creativity. Save your svg file as my_robot.svg in your docs/ directory and show a png screenshot of your rendered drawing in your write-up. Explain what you were trying to do with cubeman in words.