beautypg.com

Motorola DSP96002 User Manual

Page 601

background image

B-82

DSP96002 USER’S MANUAL

MOTOROLA

lsr d0 d0.l,d2.l

dec d2 d2.l,d4.l

neg d1 d0.l,r0

move d2.l,m0

move d1.l,n0

move d1.l,d5.l

; Draw first point

jsr _draw_point

; Draw additional points

do d4.l,_line_x_yn

inc d6 r0,d2.l

add d5,d2 (r0)+n0

cmp d4,d2

dec d7 ifge

_draw1

jsr _draw_point

_line_x_yn

rts

; Draw a single point

_draw_point

move d6.l,x:(r1)+ d7.l,y:

rts

B.1.44

Wire-Frame Graphics Rendering

WIRE-FRAME RENDITION OF A THREE DIMENSIONAL POLYLINE

ON THE MOTOROLA DSP96002

Version 1.00

OVERVIEW

This program displays a three dimensional polyline in two dimensions. The points of the polyline, as defined

in the input list, are projected into two dimensions using the perspective transformation. The projected

points are output to a display list that can be drawn by a graphics engine or a fast drawing program.

In order to maximize speed, two loops perform the graphics transformations: the trivial accept loop and the

trivial reject loop.

The trivial accept loop assumes that the last displayed point was inside the viewing pyramid and thus not

clipped. It pulls a new point from the input list, converts it to clipping space and checks if it is inside the

viewing pyramid. If so, the routine performs the perspective transformation, scales and translates the point

so it lies within the viewing window, and finally adds it to the display list.