CSCI 360

Fall 2018, Test 2


  1. Lighting: Given

    1. [4 points] Draw a diagram representing the various vectors involved in this equation. Label each and explain what each represents.
    2. [2 points] Explain the purpose of the variable α. Give several examples of values for α and state the effect of these values.
    3. [2 points] What is the purpose of the variables a,b, and c?
    4. [2 points] What does the term l·n compute? (Both math and physics) ?
  2. Event Programming
    1. [2 points] What is an event? Give examples of two distinct types of events.
    2. [2 points] What is an event handler?
    3. [2 points] What does it mean to register an event handler?
    4. [2 points] Give pseudo-code for the "main loop" for an event driven program. Explain your code.
  3. GLSL and Shaders
    1. [2 points] What is the difference between a uniform and a varying variable in GLSL?
    2. [2 points] Describe the sources of data for uniform and varying variables.
    3. [2 points] What does the GLSL function clamp do? Give a specific instance where this function could be used.
  4. Algorithms
    1. [5 points] Explain the Cohen-Sutherland line clipping algorithm.
    2. [5 points] Explain Bresenham's algorithm.
    3. [2 points] Why is Bresenham's preferred to DDA?
    4. [2 points] Explain where each of these algorithms would be implemented/invoked in the WebGL pipeline.
    5. [2 points] Why is it important that these algorithms be efficient?
    OVER (even Chris)
  5. Math
    1. [3 points] What is a normal vector? Name two places where a normal vector is used in the WebGL pipeline.
    2. [1 point] What is a normalized vector?
    3. [2 points] What does the dot product of two vectors compute? Where is this used in the WebGL pipeline?
    4. [2 points] What does the cross product of two vectors compute? Where is this used in the WebGL pipeline?
    5. [2 points] Where in the WebGL pipeline does a change of basis occur?