Nice demo

Code tips and tricks for beginners
Post Reply
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1271 times
Contact:

Nice demo

Post by cicciocb »

HI All,
I found on another forum a demo program coming from this source

As it is very simple, I rapidly adapted to Annex and I must say that the result is incredible, considering the number of lines of code

This is the result on an ILI9341 320x240
image.png

Code: [Local Link Removed for Guests]

'bubble universe demo
'credits https://github.com/ZXDunny/SpecBAS-Demos/blob/master/Graphics/bubble_universe?fbclid=IwAR2QBO8YUdsRVHMFrMe-jncZU9yTnjH3f6WaMGv0QWP_v7GnU9nAtQM66_4
''''''''''''''''''''''''
tft.fill 0
n = 200
stp = 1 ' steps; change it to change the result
scrw=320
scrh=240
r = (2*pi)/235
s = scrh / 4 ' scale
ox = scrw / 2
oy = scrh / 2
x = 0 : t = 0 : v = 0
do
  tft.fill 0
  for i=0 to n step stp
    for j=0 to n step stp
      u=sin(i+v)+sin(r*i+x)
      v=cos(i+v)+cos(r*i+x)
      x=u+t
      tft.pixel ox+u*s,oy+v*s,tft.rgb(i,j,99)
    next j
  next i
  t=t+0.025
loop
You do not have the required permissions to view the files attached to this post.
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Nice demo

Post by Fernando Perez »

Francesco, tft.pixel causes syntax error.
ESP8266, ESP32, what version of Annex do you use?

Sorry, I see that 1.48.22 with ESP32.
Beautiful.
Post Reply