Z-Buffer Algorithm - Writeup
Phil Katz and Stephen St.Vincent
home   |   images
Lab description


Lab summary:

For this lab, we implemented a Z-Buffer algorithm for our graphics environment. We added a z-buffer data field to the Image structure, and appropriate flags and modifiers to other structures. The most intricate part of the algorithm was implementing the Z-Buffer for polygons. We had to create fields to help interpolate 1/Z values for each point along each scanline, and compare these values to the current value in the Z-Buffer. We also implemented 1/Z value interpolation for each point along a line for each case of Bresenham's Line-Drawing Algorithm.


Required image
Questions:
  1. What extensions did you do for this assignment, how did you do them, and how well did they work?
    We did not do any extensions for this lab.

  2. We know z varies inversely with x and y for perspective projection. How does z vary relative to x and y for parallel projection?
    With Parallel perspective, Z varies as it would in "no-perspective" viewing: linearly with x and y.