beautypg.com

Motorola DSP96002 User Manual

Page 585

background image

B-66

DSP96002 USER’S MANUAL

MOTOROLA

org y:0

w1 dsm nsec

w2 dsm nsec

org p:$100

move #coef,r0

move #5*nsec-1,m0

move #w1,r4

move #nsec-1,m4

move #w2,r5

move m4,m5

;

; input in d7

;

move x:(r0)+,d4.s ;get b0 1 1

do #nsec,tran 2 3

fmpy d7,d4,d0 fadd.s d1,d2 x:(r0)+,d4.s y:(r4),d5.s 1 1

fmpy d7,d4,d1 fadd.s d5,d0 x:(r0)+,d4.s y:(r5),d6.s 1 1

fmpy d0,d4,d2 fadd.s d6,d1 x:(r0)+,d4.s d2.s,y:(r5)+ 1 1

fmpy d7,d4,d2 fadd.s d2,d1 x:(r0)+,d4.s d0.s,d7.s 1 1

fmpy.s d0,d4,d1 x:(r0)+,d4.s d1.s,y:(r4)+ 1 1

tran

fadd.s d1,d2 1 1

move d2.s,y:(r5)+ 1 1

move d0.s,y:$ffff

--- ---

Totals: 10 5N+6

B.1.35

3-Dimensional Graphics Illumination

Illumination of objects in three dimensions consists of light from three sources: diffuse lighting from a point

source, ambient light and specular lighting. Specular lighting is caused by an object directly reflecting the

illumination source. The following variables describe the illumination process:

L Direction vector to the point light source L={Lx,Ly,Lz}

N Direction vector normal to the object N={Nx,Ny,Nz}

Ip Intensity of the point source

Kd Diffuse reflection constant 0<= Kd <= 1.0

Ia Intensity of ambient light

Ka Ambient reflection constant 0<= Ka <= 1.0