Task 4: Barycentric coordinates

Relevant lecture: 5

Implement RasterizerImp::rasterize_interpolated_color_triangle(...) to draw a triangle with colors defined at the vertices and interpolated across the triangle area using barycentric interpolation.

Once Part 4 is done, you should be able to see a color wheel in svg/basic/test7.svg (below).

For convenience, here is a list of functions you will need to modify:

  1. RasterizerImp::rasterize_interpolated_color_triangle(...)

Color wheel map.

For Your Write-Up: Task 4

  • Explain barycentric coordinates in your own words and use an image to aid you in your explanation. One idea is to use a svg file that plots a single triangle with one red, one green, and one blue vertex, which should produce a smoothly blended color triangle.
  • Show a png screenshot of svg/basic/test7.svg with default viewing parameters and sample rate 1. If you make any additional images with color gradients, include them.
    • As a reminder, your screenshots need to be generated by using the 'S' hotkey, not using your operating systems native screenshotting mechanism. You can refer back to our guide on Using the GUI on how to generate these images, and where to find them once they’re generated.