Due date: in class, 8 Oct. 1999.
Marking:
Questions | Marker | Hours (in SF 4301) |
1-4 | Steve La | Thursday Oct 21, 3pm |
5-6 | Ryan Meredith-Jones | Tuesday Oct 19, 1pm |
The marking scheme for questions 5 & 6 available online.
h
scan lines, and w
pixels per scan line, a refresh
rate of r
frames per second, horizontal retrace
time of th
, and vertical retrace time
time of tv
. What fraction of the frame
time is spent retracing the electron beam?
(x,y)
?
XL=0
, XR=100
,
YB=0
, YT=100
,
use the Sutherland-Hodgman algorithm to clip the following
polygon against the B,R,T and L sides of the window:
i | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
xi |
10 | 60 | 60 | 120 | 60 | 40 |
yi |
70 | -20 | 40 | 20 | 120 | 70 |
Show the intermediate states of the polygon.
sx
=sy
)
commute.
x
axis.
x
-axis (Hint: how do we rotate around non-origin
points?).
n
by n
raster of pixels
such that pixel a[x][y]
is displayed at
(x,y)
, write a code fragment to reflect the
pixels about the line x=y
.
x+y=n-1
.
n
, the number of vertices in the polygon.
n
pairs of numbers, each pair being the
coordinates of a polygon vertex.
atan2
function.
Can you avoid trigonometric functions? (not easy).
Submit your commented code using one of the following.
submit -N a1q5 csc418h jordan.cpp winding.cpp submit -N a1q5 csc2504h jordan.cpp winding.cpp
In order to save your image, type 's' while the keyboard focus is on the graphics window. This will save the current image as the file 'scene.ppm'. Use xv (Unix) or xnview (Windows) in order to convert your image to the more economical gif format.
Submit your commented code and image using one of the following.
submit -N a1q6 csc418h scene.cpp scene.gif submit -N a1q6 csc2504h scene.cpp scene.gif
Several excellent scenes were submitted. Look here for the winning scene, and honorable mentions.