Mais impossible de remettre la main dessus.
J'aurais voulu essayé de l'adapté pour essayer de rendre une image de ce genre...enfin en moin précis ....

A defaut si quelqu'un sait ou trouver un algo pour tracer une spirale je réinventerais la roue ...


Code : Tout sélectionner
http://fr.wikipedia.org/wiki/Spirale_logarithmique
Code : Tout sélectionner
; code by Dobro http://michel.dobro.free.fr/
#dobro=1
#Police=1
#sprite=1
; ***********************************
Resultat = InitSprite()
FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran
EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran
WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello", #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(1)
Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0)
Resultat = InitMouse()
Structure MyHole
Rayon.l
EndStructure
Global NewList MyHole.MyHole()
For z=1 To 640 Step 4
AddElement(MyHole())
MyHole()\Rayon=640-z
Next
Repeat
ExamineMouse()
Event=WaitWindowEvent()
ClearScreen(RGB(0,0,0)) ; *****<------- si tu Rem ceci le sprite laisse une trace :D
StartDrawing( ScreenOutput())
t.f=ElapsedMilliseconds()/10000
ForEach MyHole()
CordX=640
CordY=480
x=CordX+MyHole()\Rayon*Cos(-t+ListIndex(MyHole())/10)
y=CordY+MyHole()\Rayon/2*Sin(-t+ListIndex(MyHole())/10)
x2=CordX+MyHole()\Rayon*Cos(#PI+-t+ListIndex(MyHole())/10)
y2=CordY+MyHole()\Rayon/2*Sin(#PI+-t+ListIndex(MyHole())/10)
x3=CordX+MyHole()\Rayon*Cos(#PI/2+-t+ListIndex(MyHole())/10)
y3=CordY+MyHole()\Rayon/2*Sin(#PI/2+-t+ListIndex(MyHole())/10)
x4=CordX+MyHole()\Rayon*Cos(#PI+#PI/2+-t+ListIndex(MyHole())/10)
y4=CordY+MyHole()\Rayon/2*Sin(#PI+#PI/2+-t+ListIndex(MyHole())/10)
Circle(x,y,5,$ffffff)
Circle(x2,y2,5,$ffffff)
Circle(x3,y3,5,$ffffff)
Circle(x4,y4,5,$ffffff)
Next
StopDrawing()
FlipBuffers():; affiche l'ecran
Event=WindowEvent()
If MouseButton(2)
End
EndIf
Until Event=#PB_Event_CloseWindow
Thyphoon a écrit :C'est plus qu'un debut de reponse Dobro. Merci beaucoup !
j'ai croisé ton code avec ce que j'avais fait ....
c'est pas tout a fait ça encore, mais commence a y ressembler, ça tourne dans le mauvais , sence, et le "design" n'est pas encore faire.
Bon je dois me rendre a mon boulot maintenant donc ça sera pour plus tard ....
Edit : voilà ça tourne dans le bon sens et la vitesse est mieux .....![]()
Code : Tout sélectionner
; code by Dobro http://michel.dobro.free.fr/ #dobro=1 #Police=1 #sprite=1 ; *********************************** Resultat = InitSprite() FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold ) EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello", #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered ) WindowID = WindowID(1) Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0) Resultat = InitMouse() Structure MyHole Rayon.l EndStructure Global NewList MyHole.MyHole() For z=1 To 640 Step 4 AddElement(MyHole()) MyHole()\Rayon=640-z Next Repeat ExamineMouse() Event=WaitWindowEvent() ClearScreen(RGB(0,0,0)) ; *****<------- si tu Rem ceci le sprite laisse une trace :D StartDrawing( ScreenOutput()) t.f=ElapsedMilliseconds()/40000 ForEach MyHole() CordX=640 CordY=480 x=CordX+MyHole()\Rayon*Cos(t+ListIndex(MyHole())/10) y=CordY+MyHole()\Rayon/2*Sin(t+ListIndex(MyHole())/10) x2=CordX+MyHole()\Rayon*Cos(#PI+t+ListIndex(MyHole())/10) y2=CordY+MyHole()\Rayon/2*Sin(#PI+t+ListIndex(MyHole())/10) x3=CordX+MyHole()\Rayon*Cos(#PI/2+t+ListIndex(MyHole())/10) y3=CordY+MyHole()\Rayon/2*Sin(#PI/2+t+ListIndex(MyHole())/10) x4=CordX+MyHole()\Rayon*Cos(#PI+#PI/2+t+ListIndex(MyHole())/10) y4=CordY+MyHole()\Rayon/2*Sin(#PI+#PI/2+t+ListIndex(MyHole())/10) Circle(x,y,5,$ffffff) Circle(x2,y2,5,$ffffff) Circle(x3,y3,5,$ffffff) Circle(x4,y4,5,$ffffff) Next StopDrawing() FlipBuffers():; affiche l'ecran Event=WindowEvent() If MouseButton(2) End EndIf Until Event=#PB_Event_CloseWindow
Code : Tout sélectionner
; code by Dobro http://michel.dobro.free.fr/
UsePNGImageDecoder()
#dobro=1
#Police=1
#sprite=1
; ***********************************
InitSprite()
InitSprite3D()
InitKeyboard()
FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran
EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran
WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello", #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(1)
Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0)
Debug FileSize("Gfx/holehand.png")
LoadSprite(1,"Gfx/holehand.png",#PB_Sprite_Texture|#PB_Sprite_AlphaBlending)
CreateSprite3D(1,1)
Structure MyHole
Rayon.l
EndStructure
Global NewList MyHole.MyHole()
NbStar=120
For z=NbStar To 1 Step -1
AddElement(MyHole())
MyHole()\Rayon=Pow(z,1.3)*(EcranX/4)/(NbStar*2)
Next
Repeat
ExamineKeyboard()
Event=WindowEvent()
Delay(1)
ClearScreen(RGB(0,0,0)) ; *****<------- si tu Rem ceci le sprite laisse une trace :D
;StartDrawing( ScreenOutput())
Start3D()
t.f=ElapsedMilliseconds()/10000
ForEach MyHole()
CordX=EcranX/2
CordY=EcranY/2
x=CordX+MyHole()\Rayon*Cos(t+ListIndex(MyHole())/10)
y=CordY+MyHole()\Rayon/2*Sin(t+ListIndex(MyHole())/10)
x2=CordX+MyHole()\Rayon*Cos(#PI+t+ListIndex(MyHole())/10)
y2=CordY+MyHole()\Rayon/2*Sin(#PI+t+ListIndex(MyHole())/10)
x3=CordX+MyHole()\Rayon*Cos(#PI/2+t+ListIndex(MyHole())/10)
y3=CordY+MyHole()\Rayon/2*Sin(#PI/2+t+ListIndex(MyHole())/10)
x4=CordX+MyHole()\Rayon*Cos(#PI+#PI/2+t+ListIndex(MyHole())/10)
y4=CordY+MyHole()\Rayon/2*Sin(#PI+#PI/2+t+ListIndex(MyHole())/10)
size=(ListSize(MyHole())-ListIndex(MyHole()))*128/ListSize(MyHole())
Angle=(ListSize(MyHole())-ListIndex(MyHole()))*360/ListSize(MyHole())
Alpha=255-((ListSize(MyHole())-ListIndex(MyHole()))*255/ListSize(MyHole()))
ZoomSprite3D(1,size,size)
RotateSprite3D(1,Angle,#PB_Absolute)
DisplaySprite3D(1,x,y,Alpha)
DisplaySprite3D(1,x2,y2,Alpha)
DisplaySprite3D(1,x3,y3,Alpha)
DisplaySprite3D(1,x4,y4,Alpha)
Next
Stop3D()
;StopDrawing()
FlipBuffers():; affiche l'ecran
Event=WindowEvent()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
Until Event=#PB_Event_CloseWindow
Code : Tout sélectionner
ForEach MyHole()
CordX=EcranX/2
CordY=EcranY/2
Code : Tout sélectionner
UsePNGImageDecoder()
#dobro=1
#Police=1
#sprite=1
; ***********************************
InitSprite()
InitSprite3D()
InitKeyboard()
FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran
EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran
WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello", #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(1)
Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0)
Debug FileSize("Gfx/holehand.png")
LoadSprite(1,"Gfx/holehand.png",#PB_Sprite_Texture|#PB_Sprite_AlphaBlending)
CreateSprite3D(1,1)
LoadSprite(2,"Gfx/sun.png",#PB_Sprite_Texture|#PB_Sprite_AlphaBlending)
CreateSprite3D(2,2)
Structure MyHole
Rayon.l
EndStructure
Global NewList MyHole.MyHole()
NbStar=120
For z=NbStar To 1 Step -1
AddElement(MyHole())
MyHole()\Rayon=Pow(z,1.3)*(EcranX/4)/(NbStar*2)
Next
degres=-15
Coef=10
Repeat
ExamineKeyboard()
Event=WindowEvent()
Delay(1)
ClearScreen(RGB(0,0,0)) ; *****<------- si tu Rem ceci le sprite laisse une trace :D
;StartDrawing( ScreenOutput())
Start3D()
t.f=ElapsedMilliseconds()/10000
CordX=EcranX/2
CordY=EcranY/2
ForEach MyHole()
x=MyHole()\Rayon*Cos(t+ListIndex(MyHole())/Coef)
y=MyHole()\Rayon/2*Sin(t+ListIndex(MyHole())/Coef)
x2=MyHole()\Rayon*Cos(#PI+t+ListIndex(MyHole())/Coef)
y2=MyHole()\Rayon/2*Sin(#PI+t+ListIndex(MyHole())/Coef)
x3=MyHole()\Rayon*Cos(#PI/2+t+ListIndex(MyHole())/Coef)
y3=MyHole()\Rayon/2*Sin(#PI/2+t+ListIndex(MyHole())/Coef)
x4=MyHole()\Rayon*Cos(#PI+#PI/2+t+ListIndex(MyHole())/Coef)
y4=MyHole()\Rayon/2*Sin(#PI+#PI/2+t+ListIndex(MyHole())/Coef)
; ********* voici la formule de la rotation d'image *********
;<------------ en degres !!! :o)
x= x * Cos (degres* #PI /180) +( Y)* Sin (degres* #PI /180)
Y=x * Sin (degres* #PI /180) + (Y)* Cos (degres* #PI /180)
x2= x2 * Cos (degres* #PI /180) +( y2)* Sin (degres* #PI /180)
y2= x2 * Sin (degres* #PI /180) + (y2)* Cos (degres* #PI /180)
x3= x3 * Cos (degres* #PI /180) +( y3)* Sin (degres* #PI /180)
y3= x3 * Sin (degres* #PI /180) + (y3)* Cos (degres* #PI /180)
x4= x4 * Cos (degres* #PI /180) +( Y4)* Sin (degres* #PI /180)
Y4= x4 * Sin (degres* #PI /180) + (Y4)* Cos (degres* #PI /180)
;*****************************************************
size=(ListSize(MyHole())-ListIndex(MyHole()))*128/ListSize(MyHole())
Angle=(ListSize(MyHole())-ListIndex(MyHole()))*360/ListSize(MyHole())
Alpha=255-((ListSize(MyHole())-ListIndex(MyHole()))*255/ListSize(MyHole()))
ZoomSprite3D(1,size,size)
RotateSprite3D(1,Angle,#PB_Absolute)
DisplaySprite3D(1,CordX+x-Size/2,CordY+y-Size/2,Alpha)
DisplaySprite3D(1,CordX+x2-Size/2,CordY+y2-Size/2,Alpha)
DisplaySprite3D(1,CordX+x3-Size/2,CordY+y3-Size/2,Alpha)
DisplaySprite3D(1,CordX+x4-Size/2,CordY+y4-Size/2,Alpha)
Next
;Sprite3DBlendingMode(12,6)
DisplaySprite3D(2,CordX-SpriteWidth(2)/2,Cordy-SpriteHeight(2)/2,255)
Stop3D()
;StopDrawing()
StartDrawing(ScreenOutput())
DrawText(10,10,Str(degres),$ffffff)
StopDrawing()
FlipBuffers():; affiche l'ecran
Event=WindowEvent()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
If KeyboardReleased(#PB_Key_Down) And degres>-45
degres=degres-1
EndIf
If KeyboardReleased(#PB_Key_Up) And degres<50
degres=degres+1
EndIf
Until Event=#PB_Event_CloseWindow