RafaelQuirino/dlenber

Implement Painters Algorithm to fill Object3D faces.

Opened this issue · 0 comments

Extend last homework in order to fill only the visible faces in the objects, painting them with their respective RGB colors. To do this you must add to the program the following operations:

  1. after executing transform operations to each 3D object, compute and store the normal vector and average Z depth of each face;
  2. tell which faces are visible, using the normal vector;
  3. sort visible faces from each object by depth, from the minor average Z depth to the major;
  4. employ the Painters Algorithm to fill faces, going from the most distant from the observer (minor average Z depth) to the closest (major average Z depth) and painting them with its respective color using the polygon geometric filling algorithm by scanline (implemented in a previous homework).