Task 4: Barycentric coordinates (10 pts)

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, right).

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.