Tutorial Solutions
Normals, Visibility, Shadows

  1. Normals can be transformed by assigning a value of zero to the homogeneous coordinate. Remember that the homogeneous coordinate allows for points to be translated. Vectors don't change under translation, and thus we can (and should) eliminate translation for vectors.

  2. In NDCS, we can cull based upon the sign of the z-component of the normal. This criteria also works in VCS, but will miss culling some polygons which can be culled, namely those of the type illustrated in the notes on p62. The reason that the sign-of-z is sufficient in NDCS is because the perspective transformation has already been performed. The eyepoint in VCS transforms to (0,0,-infinity) in NDCS, and thus the remaining projection is orthographic.

  3. While the values in the z-buffer will always be the same regardless of the order of the primitive processing, the image can be order-dependent. If two primitives of different colours and identical z-values are processed, the order of processing will determine which one will remain visible in the image. Suppose primitive A is processed, followed by primitive B. If the rule for updating a pixel is "update if the new z is less or equal to the old z" then primitive B will overwrite primitive A. This changes if the order of the primitives is changed.

    Similarly, if the rule for updating a pixel is "update if the new z is less than the old z", then primitive B will not overwrite primitive A. Again, this changes if the order of the primitives is changed.

  4. The scan-conversion will likely be slightly quicker for objects being oriented in the direction of the scanlines. There is a computational cost associated with computing quantities such as the z-value and colour of each pixel, but there is also a cost associated with setting up for a scan-line. The scan-conversion time will thus have a component proportional to the number of scan-lines covered by a polygon.


    1. Writing the above equations in matrix form gives:
       [ x' ]   [ 1 -dx/dy 0 0 ] [ x ]
       [ y' ] = [ 0  0     0 0 ] [ y ]
       [ z' ]   [ 0 -dz/dy 0 0 ] [ z ] 
       [ 1  ]   [ 0  0     0 1 ] [ 1 ]
      


    2. Putting the above in matrix form gives:
       [ x' ]   [ h 0  0 0 ] [ x ]
       [ y' ] = [ 0 0  0 0 ] [ y ]
       [ z' ]   [ 0 0  h 0 ] [ z ] 
       [ w' ]   [ 0 -1 0 h ] [ 1 ]
      


  5. Texture coordinates are scan-converted exactly as quantities such as z and colour are scan-converted. Point sampling causes noticable 'aliasing'. An easy example to think of is that of a terrain covered with a checker-board pattern. Imagine this terrain seen in perspective, so that the checker-board pattern gets smaller and smaller towards the horizon. At the horizon, the checkerboard pattern will be very much smaller than the size of the pixels, and the pixels should therefore be coloured a uniform grey. Point sampling will continue to hit either the black or white square of the checkerboard, producing a displeasing 'noisy' image. Aliasing is a common and interesting topic in computer graphics and will be further discussed later in class.