(A) How much memory is required to store the pixmap?
(B) At what rate (bits per second) does the video controller need to read from the frame buffer?
In NTSC format, intensity, color, and synchronization information are combined into a signal with 5MHz bandwidth. The format specification limits the effective resolution to approximately 350x350 dots on the display, regardless of display size.
(A) As we discussed in class, the pitch of the shadow mask on a color CRT is the distance between triad centers, or effectively the distance between addressable color pixels on the screen. Estimate the minimum allowable pitch of the shadow mask for your TV CRT before you start to lose resolution. Assume that the electron beam diameter must be 7/4 the pitch. Note that your answer will vary, depending on the size of your TV screen. A typical pitch for a TV shadow mask is 0.6mm.
(B) Current shadow mask technology limits pitch to approximately 0.16mm. [This is one limiting factor for creating very high resolution color displays.] If you could build a shadow mask with a pitch of 0.16mm, how small could you make a color TV CRT display (width and height) while maintaining a 350x350 dot resolution?
void MidpointLine (int x0, int y0, int x1, int y1, int value) { int dx = x1 - x0; int dy = y1 - y0; int d = 2 * dy - dx; /* initial value of d */ int incrE = 2 * dy; /* incr used for move to E */ int incrNE = 2 * (dy - dx); /* incr used for move to NE */ int x = x0; int y = y0; WritePixel (x, y, value); /* the start pixel */ while (x < x1) { if (d <= 0) { /* choose E */ d += incrE; x++; } else { /* choose NE */ d += incrNE; x++; y++; } WritePixel (x, y, value); /* the selected pixel */ } }
Just as in the algorithms for scan converting lines and circles, a decision variable d can be defined such that the choice for the next pixel to be highlighted depends only on the sign of d. This decision variable is a function of the midpoint between the E and NE pixels.
(A)Suppose you are at point (xp, yp) on the scan converted curve. Use the procedure described in class and in the text to derive the expression for decision variable d, which will be used to determine the next pixel to be highlighted.
(B)If d > 0, which pixel (E or NE) is highlighted next?
(C)An iterative algorithm can be used to increment the value of the decision variable at each step. Let d' be the decision variable for the point following (xp, yp). Define deltaE as (d'-d) when pixel E is chosen next and deltaNE as (d'-d) when pixel NE is chosen next. Write expressions for deltaE and deltaNE as functions of a, b, c, xp, and yp.
(D)Although the first order differences deltaE and deltaNE depend on xp, the second order differences depend only on coefficients a, b, and c. Let d'' be the decision parameter for the second point following (xp, yp). The second order difference is defined as [(d''-d') - (d'-d)]. Find the changes in deltaE and deltaNE when E or NE is chosen as the second point (4 cases in total). Hint: this is very similar to the midpoint circle algorithm in Section 3.3.2.
Assume that we have only two intensity values: on and off, and our application wants to draw a line of width w. The equation for the line is ax + by + c = 0. Each processor knows its x and y location. Coefficients a, b, and c are broadcast to all processors.
(A) Describe (in words) a simple algorithm that a processor
can use to determine whether the pixel it represents should be on or
off. Do not worry about clipping the line at its endpoints.
(B) Derive an expression as a function of w, a, b, c, x, and y that must be true for the pixel at (x,y) to be turned on. You may want to use the expression for distance to the line: [(ax + by + c) / sqrt(a2 + b2)]
(C) Computations performed on the main computer are usually much faster than computations performed on individual processors. It it is also expensive to broadcast information to the processors. What computations could you do on the main computer that would reduce the amount of information transferred and reduce amount of work each processor has to do?
Another way to do fast weighted area sampling is to subsample the area
covered by each pixel and use a pixel-weighting mask located at each
pixel to determine the desired pixel intensity value. The example
below shows the use of this technique for a box filter as follows:
(A) Define a pixel weighting mask to approximate a cone filter with a radius equal to 1 grid spacing. Assume that pixel intensity values can range from 0 to 256.
(B) Estimate the intensity value for the pixel shown above using your filter.
(C) What are some of the pros and cons of this approach compared to the Gupta-Sproull algorithm?
(A) Why does this occur?
(B) Does weighted area sampling fix the problem? Why or why not?
We also showed that two scale matrices with scale parameters (sx1, sy1) and (sx2, sy2) can be multiplied to obtain a matrix that scales each point by (sx1*sx2, sy1*sy2).
(A) Rederive the form for the rotation matrix as a function of angle theta.
(B) Show that two successive rotation matrices representing rotations of theta1 and theta2 can be multiplied to yield a rotation matrix representing rotation by (theta1 + theta2).
To animate the robot arm, we need to keep track of the current transform for each of the links relative to a fixed "home" position. Figure B shows the home position for link3. Write the transform to move the vertices of link3 from the position shown in Figure B to the position at the end of the robot arm in Figure A. This transform will be a function of link lengths (l1, l2, and l3), which are fixed over time, and joint angles (theta1, theta2, and theta3), which will vary as the robot arm moves.
(A)Draw the four stages of the Sutherland-Hodgeman clipping algorithm as the polygon shown below is clipped by the right, top, left, and bottom clipping planes. Number the vertices of the polygon in counterclockwise order at each stage.
(B)The result has extra edges. Describe an algorithm for cleaning up these extra edges to create two separate polygons.