Midterm 2 Guide

Past Exams

Overview

In general, the second midterm will cover the following topics:

  1. The graphic pipeline
  2. Model transforms
  3. Lighting
  4. Viewing
    • viewing transforms
    • projection transforms (orthographic and perspective)
    • pitch & yaw camera, and strafe and zoom controls
  5. The depth buffer and its use
  6. Geometric relationships, vectors, cross products, and normal computations
  7. Texture mapping

You will be able to bring one single or double sided sheet of notes into the exam. The following examples should help guide your studies, but actual question format and style will vary.

Sample questions or thought exercises:

Viewing

Illumination

Given a light with the following ambient, diffuse and specular terms:

and a material with the following ambient, diffuse and specular terms:

Assuming that the light vector is and the normal is and the view vector is what is the reflected color , computed using the Phong model? (Assume there is no distance attenuation). Show your work!

Lighting

Understand the difference between per pixel lighting and per vertex lighting

Texture mapping

Depth Buffer

Graphics pipeline

Draw a simplified version of the graphics pipeline. What happens roughly at each stage? Be sure you know what goes into the pipeline and what comes out?

Geometric relationships & Vectors

Modeling transforms and OpenGL/glm

(questions similar to midterm 1)

Carefully draw the result of the following glm code assuming that the DrawFlower() function draws the image below without the dashed lines, which are just there to show you the ‘size’ of the flower (i.e. the bounding box of the flower, ranges from a lower left corner of {-1, 0} and extends to an upper right corner of {1,3}).

Recall that rotations are specified as counter-clockwise. Carefully read all the code below before drawing.

void SetModel(glm::vec3 trans, float sf, float ang, glm::vec3 axis) {
  glm::mat4 Trans = glm::translate( glm::mat4(1.0f), trans);
  glm::mat4 Scale = glm::scale( glm::mat4(1.0f), glm::vec3(sf));
  glm::mat4 Rot = glm::rotate( glm::mat4(1.0f), angle, axis);
  glm::mat4 Model = Trans*Scale*Rot;
  safe_glUniformMatrix4fv(h_uModelMatrix, glm::value_ptr(Model));
}

/* in Draw function */
SetModel(glm::vec3(0), 1, 45, glm::vec3(0, 0, 1));
DrawFlower();
SetModel(glm::vec3(4, 0, 0), 1, -45, glm::vec3(0, 0, 1));
DrawFlower();

figure-04

figure-05