'=========================================================================== ' Subject: ROTATING SPIRAL EFFECT Date: 07-25-99 (11:58) ' Author: Marc Santa Code: QB, QBasic, PDS ' Origin: santa@tir.com Packet: GRAPHICS.ABC '=========================================================================== colour = 256 ^ 2 '0=red, 1=green, 2=blue CONST pi = 3.141592653# CONST k2 = 31.5 / pi DEF fnatn (z) = (ATN(z) * k2) CLS : SCREEN 13: xc = 160: yc = 100 FOR i = 1 TO 31: PALETTE i, i * colour: NEXT FOR i = 1 TO 32: PALETTE i + 31, (32 - i) * colour: NEXT FOR r = 1 TO 200 col = col + 64 / r: IF col > 63.5 THEN col = col - 63 col1 = 32 + CINT((col - 32))' * r / 160) CIRCLE (160, 100), r, col1: CIRCLE (161, 100), r, col1 NEXT 'PRINT ATN(TAN(PI / 4!)), PI / 4! FOR x = 0 TO 160: FOR y = 0 TO 100 IF (x = 0) THEN cc = 15.75 ELSE cc = fnatn(y / x) c1 = POINT(xc + x, yc + y): PSET (xc + x, yc + y), (c1 + cc) MOD 63 + 1 IF y THEN c1 = POINT(xc + x, yc - y): PSET (xc + x, yc - y), (c1 + 63 - cc) MOD 63 + 1 IF x * y THEN c1 = POINT(xc - x, yc - y): PSET (xc - x, yc - y), (c1 + 31.5 + cc) MOD 63 + 1 IF x THEN c1 = POINT(xc - x, yc + y): PSET (xc - x, yc + y), (c1 + 31.5 - cc) MOD 63 + 1 NEXT y: NEXT x da = -1 DO 'da = -da FOR b = 1 TO 6280 da = SIN(b / 1000) fa = fa + da * 3 IF fa <= .5 THEN fa = fa + 63 IF fa > 63.5 THEN fa = fa - 63 a = CINT(fa) FOR i = 1 TO 31 IF i + a > 63 THEN PALETTE (i + a) - 63, i * colour ELSE PALETTE (i + a), i * colour NEXT FOR i = 1 TO 32 IF i + a + 31 > 63 THEN PALETTE (i + a) - 32, (32 - i) * colour ELSE PALETTE (i + a + 31), (32 - i) * colour NEXT NEXT ' col2 = col2 + 1: IF col2 = 3 THEN col2 = 0 ' rand = INT(RND * 4) ' IF rand = 0 THEN colour = 256 ^ 2 + 256 ^ 2 + col2 ' IF rand = 1 THEN colour = 257 ' IF rand = 2 THEN colour = 258 ' IF rand = 3 THEN colour = 256 ^ 2 + 256 LOOP WHILE INKEY$ = ""