Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Bubble Universe
Author | Message | ||||
ebbandflow Newbie Joined: 31/08/2023 Location: United StatesPosts: 19 |
Hey all, I stumbled across this code called "Bubble Universe" which renders a beautiful series of images. I used "save image" on the picomite after each frame and my main computer to stitch them together into a .gif The code was ported from a version written for BAM (Basic Anywhere Machine) which I found here: Bubble Universe Code and you can run the BAM code run in browser here. TAU = 6.283185307179586 n = 100 r = TAU / 235 x = 0 y = 0 v = 0 t = 0 FILE=0 hw = MM.HRES / 2 hh = MM.HRES / 2 DO CLS FOR i = 0 TO n FOR j = 0 TO n u = SIN(i + v) + SIN(r * i + x) v = COS(i + v) + COS(r * i + x) x = u + t X1=HW+U*HW*0.4 Y1=(HH+V*HH*0.4)-((MM.HRES-MM.VRES)/2) PIXEL X1,Y1,RGB(i*2,j*2,99) NEXT NEXT t = t + .025 FILE=FILE+1 SAVE IMAGE "BUBBLE_"+STR$(FILE) PAUSE 1000 LOOP I was not able to get "SAVE COMPRESSED IMAGE" to function because it threw an "Error: Invalid for this display" which I though was odd, as "SAVE IMAGE" does work on my (2.8" ST7789) LCD. Edited 2024-01-14 23:14 by ebbandflow |
||||
Print this page |