Midterm 2 Guide
Past Exams
Overview
In general, the second midterm will cover the following topics:
- The graphic pipeline
- Model transforms
- Lighting
- Viewing
- viewing transforms
- projection transforms (orthographic and perspective)
- pitch & yaw camera, and strafe and zoom controls
- The depth buffer and its use
- Geometric relationships, vectors, cross products, and normal computations
- 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
-
Know the construction of the camera space basis vectors (u, v, w) used to build a lookat matrix.
-
Know in general what we are trying to accomplish with the viewing transforms – what are the different coordinate frames, why are they useful, why can’t we only use a matrix to accomplish perspective, What is the difference between orthographic and perspective viewing?
-
Given an eye position, a look at point and up vector, compute the camera coordinate frame.
-
If the viewing plane was at distance dv from the camera/eye - what is one way to solve for the height of a cylinder at distance d (see picture) projected onto the viewing plane using perspective? What would the height be for an orthographic projection?
Illumination
Given a light with the following ambient, diffuse and specular terms:
- light_diffuse =
- light_ambient =
- light_specular=
and a material with the following ambient, diffuse and specular terms:
- material_diffuse =
- material_ambient =
- material_specular =
- material_shininess =
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
-
Compute the reflection vector for
n = [0, 1, 0]
,l = [3, 2, 0]
: -
How is the reflection vector used in lighting computations?
-
Given a light with specific ambient, diffuse and specular terms, and a material with specific ambient, diffuse and specular terms, compute the amount of diffuse relection, specular reflection and ambient reflection for a given light position and viewing direction.
-
In general, what is the Phong model trying to model - be able to identify the different components and say something about what they are modeling (i.e. quantity of light and variables that effect the reflected light).
-
Know about the different types of materials and how they reflect light differently.
Texture mapping
- Understand the general process of texture mapping
- Why is texture filtering a problem when texture mapping?
Depth Buffer
- Understand the z-buffer algorithm.
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
-
What is the equation for a plane with the normal going through the origin? What is the equation for the plane with the same normal but which includes the point ?
-
What is the normal to a plane that includes the points:
, , ?
-
Assume that a Na’vi warrior is flying on a mountain banshee located at and can throw a spear that can only reach anything within a radius of 5.5 miles.
Currently a bad marine is on top a ship that is located at the following coordinates .
Will the Na’vi be able to defeat the marine? SHOW YOUR WORK MATHEMATICALLY!
-
Both ship and banshee are speeding through space towards the ground (with a plane equation of ).
What is each’s distance to the ground plane SHOW YOUR WORK MATHEMATICALLY!
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();