Past Midterm and Exam Questions (PDF) - Student.cs.uwaterloo.ca ...
Past Midterm and Exam Questions (PDF) - Student.cs.uwaterloo.ca ...
Past Midterm and Exam Questions (PDF) - Student.cs.uwaterloo.ca ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CS488/688 Introduction to Computer Graphi<strong>cs</strong> 31<br />
<strong>and</strong> then dividing all coordinates by the fourth coordinate.<br />
In class, we found values for mapping x <strong>and</strong> y onto the window, <strong>and</strong> z into the range [0, 1].<br />
SGI GL, on the other h<strong>and</strong>, maps x, y, z into the range [−1, 1] (x is actually mapped into slightly<br />
different values that don’t affect the discussion here).<br />
Find values of a, b, c, d, e, f that map x <strong>and</strong> y into the window, but map z to [−1, 1].<br />
14.5 Line Segments <strong>and</strong> Z [Last Used: Winter 1998 Final]<br />
If we are perspectively projecting onto a plane P (where P is perpendicular to the viewing direction<br />
<strong>and</strong> a distance n from the eye point) the mapping<br />
gives the projection of point (x, y, z) onto P .<br />
(x, y, z) → (xn/z, yn/z, n)<br />
(xn/z,yn/z,n)<br />
S=(x,y,z)<br />
E<br />
n<br />
P<br />
If we then map the end points of a line segment l onto the plane in this manner, then the line<br />
segment connecting these projected points is the projection of l. However, if we project multiple<br />
segments, we may want to know which segments occlude other segments. Thus, we need to retain<br />
some form of the z information. Be<strong>ca</strong>use this information is lost by the above mapping, we normally<br />
use a mapping similar to<br />
(x, y, z) → (xn/z, yn/z, (z − n)/z).<br />
If we use this mapping, the realtive depths of the endpoints of a line segment are preserved.<br />
1. Why do we choose the mapping given above rather than the simpler mapping<br />
(x, y, z) → (xn/z, yn/z, z)<br />
which also preserves the relative depths of the endpoints of a line segment? You do not need<br />
to prove your answer.<br />
2. We are only interested in the portions of the line segments that are within the viewing<br />
volume. Should we clip the line segments to the viewing volume before or after the perspective<br />
projection? Justify your answer.<br />
14.6 View Transformation [Last Used: Fall 2004 <strong>Midterm</strong>]<br />
Suppose we look at a unit cube from the point (.5, .5, 2) in the direction (0, 0, −1). (The unit cube<br />
has corners at (0, 0, 0), (0, 0, 1), . . . , (1, 1, 1).) From this lo<strong>ca</strong>tion, the wireframe line drawing we<br />
see will look like two squares whose corners are connected by line segments, where the inner square<br />
has sides exactly one half the length of those of the outer square. The result will look something<br />
like