

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CMSC 498M:Fall 2006 Dave Mount
Midterm Exam
This exam is closed-book and closed-notes. You may use two sheets of notes (front and back). Write answers in the exam booklet. If you have a question, either raise your hand or come to the front of class. Total point value is 100 points. Good luck!
Problem 1. (10 points) Consider the 5-sided polygon shown in the figure below (left). Assume that each vertex is represented by its x and y coordinate, for example, a = (a.x, a.y). Give the OpenGL commands to draw this polygon using a GL TRIANGLE STRIP.
c
a (^) b
d e^2
2
4
6
2 4 6
2
4
6
drawL( ) x
y
x
y (^) z
y
x
Figure 1: Problems 1 (left) and 2 (center) and 3 (right).
Problem 2. (15 points) You are given a drawing function drawL( ), which draws the L-shaped figure shown in the figure above (middle). Using the OpenGL transformation stack and this function, draw the “double-L” shape shown on its right. When you are done, the matrix stack state should be unchanged.
Problem 3. (10 points) Consider a pilot sitting in a plane, and a coordinate system associated with the pilot where the x-axis points to the pilot’s right, the y-axis points forward, and the z-axis points up. (See the figure above (right).) Explain, in this system the meaning of pitch, roll, and yaw. (Suggestion: Draw a figure.)
Problem 4. (10 points) Briefly compare and contrast the following animation methods: (a) key- frame animation, (b) procedural animation, (c) motion capture. For each, explain briefly what it means and say something about its strong/weak points (in a sentence or two).
Problem 5. (20 points) The objective of this problem is to compute physical quantities of rect- angles and shapes made up of planar rectangles.
(a) You are given a rectangle (of uniform density) whose lower-left corner is the point (x 1 , y 1 ) and whose upper-right corner is the point (x 2 , y 2 ). (See the figure below (a).) What is the center of mass of this rectangle? (b) Suppose that you are given a rectangle that is centered at the origin that has width w and height h. (See the figure below (b).) Prove that its (mass) moment of inertia about the origin is: m 12 (w^2 + h^2 ),
where m is the mass of the body. (Hint: You may use the fact that the (mass) moment of inertia of a 2-dimensional rectangle of uniform density ρ about a central point c is:
ρ
y
x
((x − cx)^2 + (y − cy)^2 ) dx dy,
where the integrals are taken over the entire height and width of the body. Also recall that a rectangle’s mass m is ρwh.)
(x2,y2)
(x1,y1)
h
w
(a) (b) (c) (c) Consider the body formed from two rectangles shown in the figure (c), one that is 1 × 3 and the other is 2 × 2. What is the center of mass of this object? (It is a rather messy fraction. You don’t need to simplify it.)
Problem 6. (15 points) Contrast the following three algorithms for path planning: (a) Best-first search, (b) Dijkstra’s algorithm, and (c) A∗-search. What are the advantages and disadvan- tages of each of these algorithms?
Problem 7. (20 points) As part of its new river rafting game, you have been asked to write a program to simulate a log flowing down a river. The river is of width W and is modeled as an infinite 2-dimensional vertical strip, that is, the region that lies between two infinite vertical lines. (See the figure below.) The log is modeled as a line segment of length L, which is allowed to rotate as it floats down the river (as logs do). You may assume that the river is wider than the log’s length, that is, W > L.
Left Bank
Right Bank
log L
W
Compute Segment Endpoints Configuration space
(a) (^) (b)
(a) Describe the log’s position as a point in some configuration space. (Hint: There are 3-degrees of freedom.) Explain carefully how an arbitrarily placed log in the river is mapped to a point in your configuration space. (For example, if you provide coordi- nates, explain where the origin is. If you provide an angle, indicate which orientation corresponds to the zero angle. A picture will help.) (b) Given an arbitrary point in your configuration space, explain how to compute the loca- tions of the log’s two endpoints (in standard (x, y) world coordinates). (c) Describe the configuration obstacles (C-obstacles) for the two banks of the river. Equiva- lently, present formulas (presented as mathematical inequalities involving the coordinates of your configuration space) that describe the conditions under which the log lies strictly between the two river banks.