CSCI 360

Fall 2019, Final Exam


  1. Bresenham's Line Algorithm Answer the questions related to the given algorithm:
      x = x1
      while x <= x2
        WritePixel(x,y,c)
        if d > 0
           y = y + 1
           d = d - 2*dx
        end if
        d = d + 2*dy
        x++ 
    1. [3 points] What are the types of all of the variables? (x,y,d, dx, dy)
    2. [5 points] What does the variable $d$ represent?
    3. [3 points] What should $d$ be initialized to be (idea, not exact value)?
    4. [3 points] Why is only the sign of $d$ considered?
    5. [6 points] Draw a diagram representing $(x_{old}, y_{old}), (x_{new}, y_{new})$ and $d$

  2. The diagram represents a basic version of the WebGL pipeline. For each stage, [1 point each] name and [3 points each] describe a process or algorithm that takes place at that stage.

  3. GLSL uses four different kinds of variables. Three of these variables are defined by qualifiers. For each kind of variable:
    1. [1 point each] Name each of the kinds of variables.
    2. [1 point each] Show how to declare a floating point instance of each.
    3. [1 point each] Describe the purpose of each of the kinds of variables.
    4. [2 points each] Describe where and how the values for each kind of variable is set.

    OVER PLEASE


  4. There are at least three reasons in which a triangle described in the modeling phase of the pipeline may not displayed in the final output. For each algorithm or technique:
    1. [1 point each] Name the algorithm or technique used to remove the triangle.
    2. [2 points each] Describe the where in the pipeline the algorithm/technique is applied.
    3. [2 points each] Describe why or how the algorithm or technique determines that the triangle will not be displayed.
    4. [3 points each] Describe the technique or give an outline the algorithm.

  5. Gourand shading employs the Phong-Blinn lighting model to make objects constructed out of polygons appear to to be smooth surfaces.
    1. [4 points] Describe the major components of this technique.
    2. [5 points] Provide the computation that must occur at each point of this technique