CS 184: COMPUTER GRAPHICS

Lecture #8 -- We: 2/17, 1999.

PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT 

Preparation:

Read Ch 3.12.4 "Cyrus Beck Line Clipping Method;" (Skip Liang-Barsky);

Lecture Topics

Review of Line Clipping in 2D. (Cohen-Sutherland)

Good for bounding boxes too !
 

Cyrus Beck Parameterized Line Clipping  { Ch 3.12.4}

A more efficient decision tree !
==> General Principle in Graphics: Don't do any unnecessary work !
Input and output = ordered sequence of vertices;
calculate the t-values of important events; then do some "ordering" comparison
Then do only the relevant clipping operations:
avoid multiple redundant clips;
avoid unnecessary coord computations (1-dimensional parameter computations are simpler/cheaper than 3-dimensional coordinate calculations)
 

A point can only be in the window, if it is simultaneously in x-strip and in y-strip

Review of Polygon Clipping. (Sutherland-Hodgman)

Need to clip away all polygon pieces that extend beyond window frame.
But we still need to maintain a properly oriented, closed polygon;
thus we need to mainatain the topology of the contour with respect to the window,
i.e., its winding number around the corners.
This can be tricky. To make things easier, we clip the polygon against one (extended) window-edge at a time. This is much easier; the contour pieces extending beyond that straight clipping edge can just be rubber-banded into a straight line segment between the exit and entry points of the contour piece that we cut off.
This whole process can then be pipelined, sending the polygon vertices through four subsequent clippers, one for each window edge.

Relevant to Homework #4 : clipped hierarchical animated scene.
 

Appreciation for the SLIDE rendering system

In CS184 a few years ago , everybody just kludged together their own system without knowing where they were headed. Now you hopefully get a much more relevant experience. See a full system, learn how it goes together, have reasonable interfaces predefined. More like SWE on  job.
But one benefit you get here: if you mess up on one homework and don't get your code to work properly,
then you will not have to live with it, but will be given a new system with a claen and robust module !
(No such luck on your future job !)
 

QUIZ #1

Discuss solutions.
Demo some things with foil -- e.g. Mate on Ship transformations.
Return Quiz.

DOF: Degrees of Freedom

How many DOF for:
line segments in 2D: (4)
infinitely long lines in 2D: (2)
spheres in 3D: (4)
planes in 3D: (3)
-- how can this be achieved ?

 


Current Homework Assignment:

ASG#3:  "Hierarchical Fish 'n' Ships"
DUE: Saturday 2/20/99, 11:59pm.
TO BE DONE with a NEW PARTNER !


--> Next Lecture

<-- Up to CS 184 HomePage


Page Editor: Carlo H. Séquin