Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : PicoMiteVGA DEMO

   Page 5 of 8    
Posted: 05:11pm
19 Nov 2024
Copy link to clipboard
javavi
Guru


Black and White Infinite Art Cubism

MODE 1
Do
 Q=Int(Rnd*5+3): If Q=7 Then Q=30
 A=Rad(360/Q): S=Sin(A): C=Cos(A)
 X=Rnd*MM.HRes: Y=Rnd*MM.VRes
 R=Rnd*(Sqr(Y+X)/20)*40+16
 For L=-R/5 To R/5
   N=(Abs(L)<R/8)*Int(Rnd*2)
   U=R+L: V=U
   X1=X+U: Y1=Y+V
   For I=1 To Q
     T=V*C-U*S: U=V*S+U*C: V=T
     X2=X+U: Y2=Y+V
     Line X1,Y1,X2,Y2,,N
     X1=X2: Y1=Y2
   Next
 Next
Loop While Inkey$=""
 
Posted: 05:32pm
26 Nov 2024
Copy link to clipboard
javavi
Guru


3D DISCO BALL

MODE 2
FRAMEBUFFER CREATE
FRAMEBUFFER WRITE F
Do
 CLS
 t=Timer
 n=7
 r=n*16
 tr=t-n*50
 ra=tr/1234
 rb=tr/2345
 For a=0 To Pi Step .39268
   For b=0 To Pi*2 Step .8-.6*Sin(a)
     o=Sin(a)*Cos(b)
     k=Sin(a)*Sin(b)
     e=Cos(a)*Cos(ra)+k*Sin(ra)
     x=(o*Cos(rb)+e*Sin(rb))*r+160
     y=(e*Cos(rb)-o*Sin(rb))*r+120
     If Cos(a)*Sin(ra)-k*Cos(ra)<.05 Then
       C=Map(Int(Rnd*14)+1)
       Circle x,y,4,,,C,C
     Else
       Circle x,y,1,,,Map(15)
     EndIf
   Next b
 Next a
 FRAMEBUFFER COPY F,N,B
Loop While Inkey$=""

Edited 2024-11-27 04:25 by javavi
 
Posted: 04:24pm
28 Nov 2024
Copy link to clipboard
Martin H.
Guru


  Martin H. said  a litle animation inspired by the planet 9 demo



With small change it also runs on Game*Mite or any other Pico with LCD
FRAMEBUFFER create
FRAMEBUFFER write f
a=100:b=3:xc=160:yc=120
For n=0 To 9:For i=n To 180 Step 10
t=(i+90)*Pi/180:x=a*Cos(t):y=b*Sin(t):cl=(y<0):ball xc+x,n*20+yc+y-112,cl
Next : For i=170+n To n Step -10
t=(i-90)*Pi/180:x=a*Cos(t):y=b*Sin(t):cl=(y<0):ball xc+x,n*20+yc+y-112,cl
Next :Next
Do
Blit 0,0,0,200,320,20:Blit 0,20,0,0,320,220:FRAMEBUFFER copy f,n:Pause 20
Loop
Sub ball bx,by,cl
For d=6 To 1Step -1
If cl Then :Color RGB(255,255-d*42,0):Else :Color RGB(0,255-d*42,255):EndIf
Circle bx+d/2,by+d/2,d,d
Next
End Sub

Edited 2024-11-29 02:29 by Martin H.
 
Posted: 05:16pm
28 Nov 2024
Copy link to clipboard
stanleyella
Guru


cool. needs mode 2 on hdmi pico 2. very fast animation, like 3d a bit!  
 
Posted: 06:16pm
28 Nov 2024
Copy link to clipboard
stanleyella
Guru


3d disco ball rotataing x axis and y axis same time?? maybe?
 
Posted: 07:38pm
28 Nov 2024
Copy link to clipboard
javavi
Guru


  stanleyella said  3d disco ball rotataing x axis and y axis same time?? maybe?

Yes, its axis rotates in three directions, but the ball itself does not spin.
Don't you have anything to see this on?
 
Posted: 08:44am
29 Nov 2024
Copy link to clipboard
Martin H.
Guru


  stanleyella said  cool. needs mode 2 on hdmi pico 2. very fast animation, like 3d a bit!  
Yes, Mode 2 was included in the original listing. The pseudo 3D visualisation was inspired by the old Amiga demos.
The slight offset when drawing the spheres results in the rotation that occurs when simply scrolling up  
 
Posted: 09:01am
29 Nov 2024
Copy link to clipboard
javavi
Guru


Have a question for experts of retro computer graphics!?

The BBS micro computer had a video mode in which it was possible to form a picture in a palette of 16 colors, and by changing the palette display mode, only 4 colors were displayed. Quickly switching the color palette display mode gave the effect of a moving picture in a cycle. How can this be implemented on PicoMite ?
 
Posted: 09:16am
29 Nov 2024
Copy link to clipboard
matherp
Guru

  Quote  How can this be implemented on PicoMite ?


Using the map command and function. Ages ago Stanley posted an example of doing exactly this. Perhaps he can post a reference
 
Posted: 10:01am
29 Nov 2024
Copy link to clipboard
Martin H.
Guru


  javavi said  Have a question for experts of retro computer graphics!?

The BBS micro computer had a video mode in which it was possible to form a picture in a palette of 16 colors, and by changing the palette display mode, only 4 colors were displayed. Quickly switching the color palette display mode gave the effect of a moving picture in a cycle. How can this be implemented on PicoMite ?


here is an example: Animation using MAP Command
Edited 2024-11-29 20:02 by Martin H.
 
Posted: 03:17pm
29 Nov 2024
Copy link to clipboard
stanleyella
Guru


  javavi said  Have a question for experts of retro computer graphics!?

The BBS micro computer had a video mode in which it was possible to form a picture in a palette of 16 colors, and by changing the palette display mode, only 4 colors were displayed. Quickly switching the color palette display mode gave the effect of a moving picture in a cycle. How can this be implemented on PicoMite ?

The Amstrad 464 had the same sort of palette switching as the bbc micro.
@Matherp sorted it for pico and called it map. On arduino, map is scale a value, on GCBasic they wanted to implement map but wanted another name for it, I suggested scale, which stuck.
 
Posted: 01:07pm
30 Nov 2024
Copy link to clipboard
javavi
Guru


Attracting Star Whirlpool

MODE 2
Dim integer cm(15)=(0,14,0,7,0,0,6,0,0,4,0,0,2,0,0,0)
Colour Map cm(),cm()

Q=.375
For E=1 To 40 Step .025
 R=E*E/4:T=R/99
 s1=Sin(T):c1=Cos(T)
 N=5+R/1:A=-Pi*2/N
 S=Sin(A):C=Cos(A)
 X=0:Y=R:I=Rnd
 For L=0 To N
   I=I+1 And 15: If I=0 Then I=1
   Color Map(I)
   Pixel 160+X*c1*Q-Y*s1,120+X*s1*Q+Y*c1
   x1=X*C-Y*S:Y=X*S+Y*C:X=x1
 Next
Next

Do
 T=cm(1)
 For i=1 To 15-1:cm(i)=cm(i+1):Next
 cm(15)=T
 For i=1 To 15:Map(i)=cm(i):Next
 Map Set
 Pause 50
Loop

Gratitude:  matherp, Martin H., stanleyella
Edited 2024-12-01 01:40 by javavi
 
Posted: 07:08pm
30 Nov 2024
Copy link to clipboard
stanleyella
Guru


nice one javavi  
make it go in reverse maybe?
Edited 2024-12-01 05:41 by stanleyella
 
Posted: 08:09pm
30 Nov 2024
Copy link to clipboard
javavi
Guru


  stanleyella said  nice one javavi  
make it go in reverse maybe?

MODE 2
Dim integer cm(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map cm(),cm()

Q=.375
For E=1 To 40 Step .025
R=E*E/4:T=R/99
s1=Sin(T):c1=Cos(T)
N=5+R/1:A=-Pi*2/N
S=Sin(A):C=Cos(A)
X=0:Y=R:I=Int(Rnd)
For L=0 To N
  I=I+1 And 15: If I=0 Then I=1
  Color Map(I)
  Pixel 160+X*c1*Q-Y*s1,120+X*s1*Q+Y*c1
  x1=X*C-Y*S:Y=X*S+Y*C:X=x1
Next
Next

Do
T=cm(15)
For i=15 To 1+1 Step -1:cm(i)=cm(i-1):Next
cm(1)=T
For i=1 To 15:Map(i)=cm(i):Next
Map Set
Pause 50
Loop

Edited 2024-12-01 06:11 by javavi
 
Posted: 09:08pm
30 Nov 2024
Copy link to clipboard
stanleyella
Guru


nice! is pico and mmbasic brill?
looks like star trek ds9 wormhole :)
Edited 2024-12-01 07:48 by stanleyella
 
Posted: 09:21pm
30 Nov 2024
Copy link to clipboard
javavi
Guru


  stanleyella said  nice! is pico and mmbasic brill?

WonderfulBeautifulAmazingLoveFantasticBrilliantAwesome
Edited 2024-12-02 03:50 by javavi
 
Posted: 06:08pm
01 Dec 2024
Copy link to clipboard
javavi
Guru


Toroidal Reactor   ITER

MODE 2
Map Reset
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
     k1=Sqr(X*X+Z*Z)-2
     d1=1-Sqr(k1*k1+Y*Y)
     X=X+x1*d1:Y=Y+y1*d1:Z=Z+d1
   Loop Until d1<.005
   v1=Atn(Z/X):u1=Atn(Y/k1)
   sColor(): Pixel U,V
   v1=3.13-v1
   sColor(): Pixel 319-U,V
 Next
Next

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

Dim integer cm(15)=(0,15,7,1,0,0,0,0,0,0,0,0,0,0,0,0)
Colour Map cm(),cm()
Do
 T=cm(1)
 For i=1 To 15-1:cm(i)=cm(i+1):Next
 cm(15)=T
 For i=1 To 15:Map(i)=cm(i):Next
 Map Set
 Pause 50
Loop

Edited 2024-12-02 04:09 by javavi
 
Posted: 06:41pm
01 Dec 2024
Copy link to clipboard
stanleyella
Guru


that's impressive! thanks. I had to learn trig years after school. never used it until started using pics
 
Posted: 07:35pm
01 Dec 2024
Copy link to clipboard
twofingers
Guru

Neat!   I immediately thought of "Wendelstein".
In my version, I save the image when it is created for the first time and load it when it is repeated. This is a bit faster - I'm so impatient!
I changed the rotating palette as follows:
Dim integer cm(15)=(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)

This makes the result more colorful.
Best regards
Michael
Edited 2024-12-02 06:05 by twofingers
 
Posted: 12:49pm
02 Dec 2024
Copy link to clipboard
javavi
Guru


  twofingers said  This makes the result more colorful.

MODE 2
Map Reset
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

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

'Dim integer cm(15)=(0,15,7,1,0,0,0,0,0,0,0,0,0,0,0,0)
Dim integer cm(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map cm(),cm()
Do
 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
Loop

 
   Page 5 of 8    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025