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 ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CS488/688 Introduction to Computer Graphi<strong>cs</strong> 7<br />
4.2 Anticlipping [Last Used: Winter 1986 <strong>Midterm</strong>]<br />
Discuss the changes necessary to draw only the portion(s) of a line segment that is(are) not contained<br />
within the clipping region. You may assume that points lying on the border of the clipping region<br />
are to be drawn. Show the outcode <strong>and</strong> window edge coordinate definitions for this <strong>ca</strong>se. Be sure<br />
to include the conditions for trivial acceptance <strong>and</strong> rejectance.<br />
4.3 Cross Product Rejection [Last Used: ?]<br />
The magnitude of the cross product between two vectors, v <strong>and</strong> w, is given by<br />
|v × w| = |v||w| sin(θ).<br />
The direction of the cross product perpendicular to the plane of v <strong>and</strong> w <strong>and</strong> points in the direction<br />
of the right h<strong>and</strong>’s thumb when the right h<strong>and</strong>’s fingers are curled in the v,w-plane from v to w.<br />
The magnitude of the cross product is just the area of the parallelepiped whose two adjacent sides<br />
are the vectors v <strong>and</strong> w.<br />
Show that, if a clipping window is defined in the x,y-plane, an acceptance/rejection test <strong>and</strong><br />
window-edge coordinates for points <strong>ca</strong>n be derived from the cross product.<br />
4.4 Polygon Splitting [Last Used: Fall 1990]<br />
You are given a sequence of three or more vertices p 0 , p 1 , p 2 , ... defining a convex polygon O in<br />
3-space, <strong>and</strong> the equation Ax + By + Cz + D = 0 of an arbitrarily oriented plane P . Describe an<br />
algorithm that splits O into two polygons O 1 <strong>and</strong> O 2 , with O 1 lying on or to one side of P , <strong>and</strong> O 2<br />
lying on or to the other side of P .<br />
Clearly written <strong>and</strong> commented pseudo-code or English is desired here, not hacker’s C. Be<br />
<strong>ca</strong>reful to explain <strong>and</strong> justify how each step of the computation is performed.<br />
4.5 Sutherl<strong>and</strong>-Hodgman Clipping [Last Used: Winter 1994 Final]<br />
The Sutherl<strong>and</strong>-Hodgman polygon clipping algorithm is described in the text in terms of a single<br />
clipping boundary. In practice we usually want to clip against some viewport. This involves passing<br />
the polygon through a series of clippers. For example:<br />
POLYGON->TopClipper->BottomClipper->LeftClipper->RightClipper->RESULT<br />
If we need to clip an edge at a boundary an expensive intersection <strong>ca</strong>lculation must be performed.<br />
(a) Show that the number of intersection <strong>ca</strong>lculations required is dependent on the order of the<br />
clippers. HINT: Consider the diagram below.<br />
(b) Prove, or give a counter-example to the statement : “In general there is a BEST ordering of<br />
the clippers.”