For the scanline fill function, we had to do a similar calculation inside our innermost loop and set the color appropriately.
Required Image 1: A cube with the depth inverted
Required Image 2: A grouping of cubes rotating showing depth
Blue Crossed Crosses getting closer to the screen
In this last picture, yo can see that as we get closer, the crosses get brighter and this shows a change in depth.