BBS: Inland Empire Archive Date: 03-21-93 (03:41) Number: 353 From: RICH GELDREICH Refer#: NONE To: ALL Recvd: NO Subj: Solid5 3/8 Conf: (2) Quik_Bas

'Page 3 of SOLID5.BAS begins here.s1! = SIN(a1!): c1! = COS(a1!) s2! = SIN(a2!): c2! = COS(a2!) lx = 128 * s1! * c2!'convert spherical coordinates to a vectorly = 128 * s1! * s2!'scale up by 128 for integer mathlz = 128 * c1!FORa = -128TO128'precalculate the three light source tableslx(a + 128) = lx * a'for fast Lambert shadingly(a + 128) = ly * a lz(a + 128) = lz * aNEXTDO:LOOPWHILEINKEY$= "" R1 = 0: R2 = 0: R3 = 0'three angles of rotationox = 0: oy = -50: oz = 1100'object's origin (this program cannot _currently'handle the object when it goes behind the_ viewer!) s = 1: t = 0SCREEN7, , 0, 0OUT&H3C8, 0'set 16 shadesFORa = 0TO15OUT&H3C9, (a * 34) \ 10OUT&H3C9, (a * 212) \ 100OUT&H3C9, (a * 4) \ 10IFa = 7THENOUT&H3C7, 16: OUT &H3C8, 16NEXTLINE(0, 100)-(319, 199), 9, BFLINE(0, 0)-(319, 99), 3, BFSCREEN7, , 1, 0LINE(0, 100)-(319, 199), 9, BFLINE(0, 0)-(319, 99), 3, BF YHigh(0) = -32768: ShadowYHigh(0) = -32768 YHigh(1) = -32768: ShadowYHigh(1) = -32768DO'Flip active and work pages so user doesn't see our messy drawingSCREEN7, , s, t:SWAPs, t'Wait for vertical retrace to reduce flickerWAIT &H3DA, 8'Erase the old image from the screenIFYHigh(s) <> -32768THENIFYHigh(s) < 100THENLINE(XLow(s), YLow(s))-(XHigh(s), YHigh(s)), 3, BFELSEIFYLow(s) < 100THENLINE(XLow(s), YLow(s))-(XHigh(s), 99), 3, BFLINE(XLow(s), 100)-(XHigh(s), YHigh(s)), 9, BFELSELINE(XLow(s), YLow(s))-(XHigh(s), YHigh(s)), 9, BFENDIFENDIFIFShadowYHigh(s) <> -32768THENLINE(ShadowXLow(s), ShadowYLow(s))-(ShadowXHigh(s), ShadowYHig_ h(s)), 9, BFENDIFRotatePoints CullPolygons ShadePolygons XLow(s) = 32767: XHigh(s) = -32768 YLow(s) = 32767: YHigh(s) = -32768 DrawShadows DrawObject R1 = (R1 + D1)MOD360:IFR1 < 0THENR1 = R1 + 360 R2 = (R2 + D2)MOD360:IFR2 < 0THENR2 = R2 + 360 R3 = (R3 + D3)MOD360:IFR3 < 0THENR3 = R3 + 360 oz = oz + dz: ox = ox + dxIFoz < 600THENoz = 600: dz = 0ELSEIFoz > 8000THENoz = 8000: dz = 0ENDIFIFox < -4000THENox = -4000: dx = 0ELSEIFox > 4000THENox = 4000: dx = 0ENDIFa$ =INKEY$SELECTCASEa$CASE"4" D1 = D1 - 2CASE"6" D1 = D1 + 2CASE"8" D2 = D2 - 2CASE"2" D2 = D2 + 2CASE"5"'Continued on page 4--- MsgToss 2.0b * Origin: Computer Co-Op - Voorhees, NJ | Ted Hare (1:266/29)

Echo Basic Postings

**Books at Amazon:**

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET