09-25-2004, 05:05 AM
Probably someone has had this idea before....
While trying to do something for Adigun's textmode 7liners contest, I found that the back/fore color of a char gives you two separate chanels where you can draw different plasmas. The char 177 is an uniform pattern of back and foreground pixels, so if you fill a screen of it you have a translucency effect without effort.
Here it is, without the constraint of the 7 lines:
Can someone point me to a good tutorial about plasmas?
While trying to do something for Adigun's textmode 7liners contest, I found that the back/fore color of a char gives you two separate chanels where you can draw different plasmas. The char 177 is an uniform pattern of back and foreground pixels, so if you fill a screen of it you have a translucency effect without effort.
Here it is, without the constraint of the 7 lines:
Code:
' Translucent Textmode Plasma by Antoni Gual September/2004
'
WIDTH , 50
CONST mo = 511
CONST fa = (mo + 1) / 2 / 3.141592
DO WHILE LEN(INKEY$): LOOP
DEF SEG = &HB800
PRINT STRING$(80 * 50, 177); '176, 177,178
DIM A(mo), b(mo), c(mo), D(mo), e(mo)
FOR i% = 0 TO mo
A(i%) = .31 * COS(i% * 4 / fa)
b(i%) = .47 * COS(i% * 13 / fa)
c(i%) = .41 * COS((i% + 21) * 7 / fa)
D(i%) = 20 * COS(i% * 5 / fa)
e(i%) = 8 * COS((i% + 31) * 1 / fa)
NEXT
DO
f& = f& + 1
k% = 50 * c(f& AND mo) + 51
k1% = 240 * A((f& + 30) AND mo) + 241
FOR i% = 0 TO 49
i1% = i% * 160
FOR j% = 1 TO 159 STEP 2
fore% = 13.5 + b(k%) + A((j% - D(j%) + k1%) AND mo) + c((j% + D(i%) + e(k%)) AND mo)
back% = 3.5 + c(k%) + c((j% + D(i%) - k%) AND mo) + c((e(k1%) + i% + f&) AND mo)
POKE i1% + j%, 16 * back% + fore%
NEXT j%, i%
LOOP UNTIL INP(&H60) = 1
Can someone point me to a good tutorial about plasmas?
Antoni