'=========================================================================== ' Subject: SIN/COS PLASMA Date: 01-15-97 (17:54) ' Author: Uncle Shackles Code: QB, QBasic, PDS ' Origin: shadebob@algonet.se Packet: GRAPHICS.ABC '=========================================================================== ' ********************************************************* ' * Some sort of SIN/COS plasma by Uncle Shackles in 1997 * ' ********************************************************* ' Note! You will need a Pentium to get this run fast... For best performance, ' compile to an EXE file and run in DOS mode, skip AUTOEXEC.BAT and ' CONFIG.SYS! ' Want to contact me? Send an e-mail to ! DEFINT A-Z h: INPUT "Size (1 - 100, ENTER = 50): ", size IF size = 0 THEN size = 50 IF size < 1 THEN PRINT "Too small!": GOTO h IF size > 100 THEN PRINT "Too big!": GOTO h SCREEN 13 DEF SEG = &HA000 OUT &H3D4, 9 OUT &H3D5, 3 pi = 3.141592653589793# DIM v1 AS SINGLE, v2 AS SINGLE, v3 AS SINGLE v2 = 170: v3 = 260 DIM rot(size ^ 2) FOR y = 0 TO size - 1 FOR x = 0 TO size - 1 rot(x + (y * (size))) = SQR((x ^ 2) + (y ^ 2)) NEXT x NEXT y DIM r(256), g(256), b(256) FOR x = 0 TO 63 OUT &H3C9, x: r(x) = x OUT &H3C9, 0 OUT &H3C9, 0 NEXT x FOR x = 0 TO 63 OUT &H3C9, 63: r(x + 64) = 63 OUT &H3C9, 0 OUT &H3C9, x: b(x + 64) = x NEXT x FOR x = 0 TO 63 OUT &H3C9, 63 - x: r(x + 128) = 63 - x OUT &H3C9, x: g(x + 128) = x OUT &H3C9, 63: b(x + 128) = 63 NEXT x FOR x = 0 TO 63 OUT &H3C9, 0 OUT &H3C9, 63 - x: g(x + 192) = 63 - x OUT &H3C9, 63 - x: b(x + 192) = 63 - x NEXT x DIM val4 AS SINGLE DIM grad2rad AS SINGLE grad2rad = pi / 180 DIM h AS SINGLE, add2 AS SINGLE, val1 AS SINGLE, val2 AS SINGLE, add9 AS SINGLE, gr AS SINGLE h = 100 / 1.2 PALETTE 255, ((256 ^ 2) * 63) + (256 * 63) + 63 LOCATE 11, 19: COLOR 255: PRINT "Code by Uncle Shackles" g: FOR y = 0 TO size - 1 FOR x = 0 TO size - 1 add3 = add2 * x add4 = add9 * y val1 = grad2rad * (add3 + (x * (rot(x + (y * (size))) / 20) + add5)) xx = (SIN(val1) * 100) + 128 val2 = grad2rad * (add4 + (y * (rot(x + (y * (size))) / 20) + add6)) yy = (COS(val2) * h) + 128 z = (xx + yy) / 2 PSET (x * 2, y), z: PSET (x * 2 + 1, y), z NEXT x NEXT y add5 = add5 + 3 add6 = add6 + 2 gr = gr + 1 add2 = (SIN(grad2rad * gr) * 4) - 4 add9 = (COS(grad2rad * gr) * 5) - 4 IF INKEY$ <> "" THEN END FOR x = 0 TO 5 GOSUB rotpal NEXT x FOR x = 2 TO 249 OUT &H3C7, x OUT &H3C9, r(x) OUT &H3C9, g(x) OUT &H3C9, b(x) NEXT GOTO g rotpal: tr = r(0) tg = g(0) tb = b(0) FOR x = 1 TO 255 r(x - 1) = r(x) g(x - 1) = g(x) b(x - 1) = b(x) NEXT x r(255) = tr g(255) = tg b(255) = tb RETURN