PicoMiteVGA DEMO


Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1459
Posted: 02:05pm 07 Dec 2024      

  javavi said   Toroidal Reactor  MODE 2  Stellarator

'Toroidal Reactor by javavi/2024
MODE 2
Map Reset

Dim PicFile$="TOR.bmp"
Dim integer cm(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map cm(),cm()

If MM.Info(exists file PicFile$) Then
 Load image PicFile$
Else
 For U=0 To 159
   x1=U/128-1.25
 For V=0 To 239
   y1=V/128-1
   X=0:Y=X:Z=-2.4
   Do
     k=Sqr(X*X+Z*Z)-2
     d=1-Sqr(k*k+Y*Y)
     X=X+x1*d:Y=Y+y1*d:Z=Z+d
   Loop Until d<.005
   v1=Atn(Z/X):u1=Atn(Y/k)
   sColor(): Pixel U,V
   v1=3.13-v1
   sColor(): Pixel 319-U,V
 Next :Next
 Save image PicFile$
EndIf

Do
 For N=0 To 31
   T=cm(0)
   For i=0 To 14:cm(i)=cm(i+1):Next
   cm(15)=T
   For i=0 To 15:Map(i)=cm(i):Next
   Map Set
   Pause 50
 Next
 For i=0 To 15
   If i<4 Then cm(i)=Map(Int(Rnd*15)) Else cm(i)=0
 Next
Loop

Sub sColor()
 p=Sin(Int((u1+v1)*40)*99)*98
 c=15 And ((u1-v1+p)*24*Abs(Sin(p)))
 Color Map(c)
End Sub


if you replace PAUSE 50 with FRAMEBUFFER wait then it really gets going