Motorola DSP96002 User Manual

Page 607

Advertising
background image

B-88

DSP96002 USER’S MANUAL

MOTOROLA

The reject loop single point clipping code is very similar to the analogous code in the accept loop. It calls

the same clipping subroutines in lines 520-617. Then the point that was just calculated is transformed,

scaled and translated and stored in the output list (lines 305-321). Finally, the new point (which was ac-

cepted) is transformed, scaled and translated (lines 327-345). Control is transferred to the accept loop.

REJECT LOOP DOUBLE POINT CLIPPING CODE

Lines 359-492 are a direct implementation of a clipping algorithm using endpoint coordinates given in {1}.

The clipping method using determinants is not powerful enough to handle the cases where the line is re-

jected but not trivially rejected. Thus, the line parameters t1 and t2 are calculated explicitly. The t1 param-

eter is calculated based on the coordinates of the old point and the t2 parameter is calculated based on

the current point.

These parameters are calculated by a set of double point clipping subroutines in lines 631-853. These sub-

routines are called based on the coordinates in lines 359-395.

The line is checked for rejection which occurs when t1 > t2. If the line is not rejected, the plane intersections

are interpolated based on t1 and t2 (lines 409-431). Then the two new points are transformed, scaled and

translated in lines 437-478. Control is then transferred to the reject loop.

If the line is rejected, control is transferred to the reject loop after some housekeeping is performed.

TERMINATION CODE

Lines 499-509 swallow the line delimiter code (-1.0) if it is the last coordinate in the display list. Then it adds

the end of display list code (-2.0) to the display list and exits.

REFERENCE

{1} William M. Newman and Robert F. Sproull, Principles of Interactive

Computer Graphics, (New York: McGraw-Hill, 1979).

;

; WIRE-FRAME RENDITION OF A THREE DIMENSIONAL POLYLINE

; ON THE MOTOROLA DSP96002

;

; Version 1.00 18-Nov-88

;

;

;

;---------------------------------------------------------

;

; First point

;

;---------------------------------------------------------

; Transform to clip space

Advertising