CSCI 360
Fall 2018,
Test 2
- Please answer each question carefully and thoughtfully. You need
to demonstrate that you understand the material covered.
- Use as many pages as you wish, but make sure that you label each answer with the question number.
- Please write neatly, and print if possible. If I can't read your answer, it is incorrect.
- Please make sure that your name is on your test.
- Please make sure that you answer all parts of the questions.
- Lighting: Given
- [4 points] Draw a diagram representing the various vectors involved in this equation. Label each and explain what each represents.
- [2 points] Explain the purpose of the variable α. Give several examples of values for α and state the effect of these values.
- [2 points] What is the purpose of the variables a,b, and c?
- [2 points] What does the term l·n compute? (Both math and physics) ?
- Event Programming
- [2 points] What is an event? Give examples of two distinct types of events.
- [2 points] What is an event handler?
- [2 points] What does it mean to register an event handler?
- [2 points] Give pseudo-code for the "main loop" for an event driven program. Explain your code.
- GLSL and Shaders
- [2 points] What is the difference between a uniform and a varying variable in GLSL?
- [2 points] Describe the sources of data for uniform and varying variables.
- [2 points] What does the GLSL function clamp do? Give a specific instance where this function could be used.
- Algorithms
- [5 points] Explain the Cohen-Sutherland line clipping algorithm.
- [5 points] Explain Bresenham's algorithm.
- [2 points] Why is Bresenham's preferred to DDA?
- [2 points] Explain where each of these algorithms would be implemented/invoked in the WebGL pipeline.
- [2 points] Why is it important that these algorithms be efficient?
OVER (even Chris)
- Math
- [3 points] What is a normal vector? Name two places where a normal vector is used in the WebGL pipeline.
- [1 point] What is a normalized vector?
- [2 points] What does the dot product of two vectors compute? Where is this used in the WebGL pipeline?
- [2 points] What does the cross product of two vectors compute? Where is this used in the WebGL pipeline?
- [2 points] Where in the WebGL pipeline does a change of basis occur?