-------------------------------------------- student : yusui graded by : Damian Isla problem set: ivscan -------------------------------------------- Renders 1st test (triangle) (0-3): 2 Renders 2nd test (rgb) (0-2): 2 Renders 3rd test (cube) (0-2): 1.5 Renders 4th test (interpen) (0-2): 0.5 Renders 5th test (ellipse) (0-2): 0 Renders 6th test (geekball) (0-2): 1 Exactitude (0-2): 2 total (0-15): 9 -------------------------------------------- notes: There are a few serious problems with your renderer: 1) Most seriously, your ivscan crashed when running the last two of the above tests (ellipse and geek ball). The cause is an assertion error. The place in which this error occurs would suggest to me that you're taking edges off of the active edge list at the wrong time. 2) There were certain occasions (e.g. sometimes when rendering the cube.iv) where a crack would appear between two polygons that should have been flush and/or when some strange artifacts appear around the corners of the models. 3) Interpen.iv does not work correctly -- there is some sort of problem with your visibility calculation. In fact, I think if you flipped the sign on your z-buffer entries it would probably work correctly. And more subtle problems: 4) You were not correctly intializing the EdgeRec, in that you were not correctly adjusting the starting value of X to account for the start of the edge being off-pixel-center. i.e. the initial value of xcurr does NOT equal xstart, but rather xstart + epsilon (finding epsilon is the trick). Because what you REALLY want is the value of X at the intersection of the edge with the next scan line. Note that it is not JUST X that should be adjusted in this way, but also color and depth (and inverse depth). 5) The above also counts for when you're interpolating along a scan-line (in RenderScanLine()). For each pixel that you light up, you want to take the values of color and depth at the CENTER of the pixel you're considering. So, if the starting X of an edge does not happen to be at the center of a pixel, you need to adjust the starting values of h and color to find their correctly interpolated values at the center of the first pixel. The formula for this 1-D case is: hstart = e1->hstart + (pixelCenter_X - e1->xcurr) * (e1->hcurr - e2->hcurr) / (e1->xcurr - e2->xcurr) and likewise for color. Where pixelCenter_X is the X-coordinate of the center of the first pixel you're lighting up, e1 is the first edge and e2 is the second edge. --------------------------------------------