Code : Tout sélectionner
InitSprite() ;Initialise le moteur gérant l'ecran et les sprites
InitSprite3D() ;Initialise le moteur gérant l'ecran et les sprites
InitMouse()
InitKeyboard() ;Initialise le moteur gérant les accès claviers
UseJPEGImageDecoder()
Dim r.w(2048,1536)
Dim v.w(2048,1536)
Dim b.w(2048,1536)
Dim p(1024*768)
OpenScreen(1024,768,32,"") ;Ouvre un ecran de 800x600x32 dont le nom est ""
LoadSprite(0,"image 1024*768*16M.jpg") ;On charge le sprite N°0 en mémoire ( fond d'écran 800x600 )
DisplaySprite(0,0,0) ;On affiche le sprite modifié
StartDrawing(SpriteOutput(0))
For u=0 To 767
For i=0 To 1023
x=Point(i,u)
r(512+i,384+u)=Red(x)
v(512+i,384+u)=Green(x)
b(512+i,384+u)=Blue(x)
Next
Next
StopDrawing()
FreeSprite(0)
CloseScreen()
;;;;;;;;;;;;;;;;;;;;;*;*;*;*;*;*;*;;;;;;;;;;;;;;;;;;;;;;;
OpenScreen(1024,768,32,"") ;Ouvre un ecran de 800x600x32 dont le nom est ""
Dim zoom0.f(200)
Dim zoom02.f(200)
Dim trans(200)
gro=130
zoom0(0)=0
For i=0 To 200
zoom0(i)=Sin(i/300)+Cos(i/90)
trans(i)=gro
Next
bx.f=0
cx.f=0.0000005
zoom02(0)=0
For i=0 To 200
zoom02(i)=bx
trans(i)=gro
bx+0.002+cx
cx*1.1
Next
Dim zx(200,200)
Dim zy(200,200)
Dim zx2(200,200)
Dim zy2(200,200)
For i=0 To gro
For u=0 To gro
x0=Sqr(i*i+u*u)
If x0<=gro
zx(i,u)=i*(1+zoom0(x0))
zy(i,u)=u*(1+zoom0(x0))
zx2(i,u)=i*(1+zoom02(x0))
zy2(i,u)=u*(1+zoom02(x0))
Else
If trans(i)=gro
trans(i)=u-1
EndIf
EndIf
Next
Next
Dim zoom(200)
Dim zoom2(200)
For i=0 To 200
zoom(i)=zoom0(i)
zoom2(i)=zoom02(i)
Next
Dim zoom0.f(1)
Dim zoom02.f(1)
xxx=0
yyy=0
xx0.f=0.22
xx1.f=0.31
Repeat
ClearScreen (0,0,0)
xxx0=640+Cos(xx0)*370-gro
yyy0=480+Sin(xx1)*220-gro
xx0+0.0292
xx1+0.046
StartDrawing(ScreenOutput())
For u=0 To gro
For i=0 To trans(u)
zx=zx(i,u)
zy=zy(i,u)
rx=511+xxx0-xxx+zx
ry=383+yyy0-yyy+zy
zx2=zx2(i,u)
zy2=zy2(i,u)
rx2=511+xxx0-xxx+zx2
ry2=383+yyy0-yyy+zy2
Plot (xxx0+i,yyy0+u,RGB((r(rx,ry)+r(rx2,ry2)*3)/4,(v(rx,ry)+v(rx2,ry2)*3)/4,(b(rx,ry)+b(rx2,ry2)*3)/4))
rx-zx*2
rx2-zx2*2
Plot (xxx0-i,yyy0+u,RGB((r(rx,ry)+r(rx2,ry2)*3)/4,(v(rx,ry)+v(rx2,ry2)*3)/4,(b(rx,ry)+b(rx2,ry2)*3)/4))
ry-zy*2
ry2-zy2*2
Plot (xxx0-i,yyy0-u,RGB((r(rx,ry)+r(rx2,ry2)*3)/4,(v(rx,ry)+v(rx2,ry2)*3)/4,(b(rx,ry)+b(rx2,ry2)*3)/4))
rx+zx*2
rx2+zx2*2
Plot (xxx0+i,yyy0-u,RGB((r(rx,ry)+r(rx2,ry2)*3)/4,(v(rx,ry)+v(rx2,ry2)*3)/4,(b(rx,ry)+b(rx2,ry2)*3)/4))
Next
Next
StopDrawing()
FlipBuffers() ;On inverse le Buffer ( notion que l'on verra + tard )
;ClearScreen (0,0,0)
ExamineKeyboard() : Until KeyboardPushed(#PB_Key_Escape): End
