Re: Algo Black Hole Spiral
Publié : mer. 28/oct./2009 10:54
....
J'ai cru comprendre que dans 8 jours tu y sera au vert (et bleu), c'est ça ?Dobro a écrit :oui ! bah , il est temps que je me mette au vert moi !!
il marche tres bien ton code !
j'aurais plutôt dit !Kwai chang caine a écrit :Un forum sans DOBRO...c'est une fille en combinaison de ski
C'est gentil ça !j'imagine les commentaires des photos :Dobro a écrit :oui ! oui! pour le coup c'est vous qui allez etre en vacances ...
soit dit en passant, je vous mettrai quelques photo de temps en temps
histoire de partager
sa ne serais pas tirait des inconnus sa ?Un forum sans DOBRO...c'est comme une nuit sans femme !!!
c'est comme la mer sans les vagues
c'est comme les vagues sans l'écume
c'est comme l'écume sans le sel
c'est comme le sel sans le poivre .... Je m'égare là lolllllllllllllll !
il va nous faire rager avec ces photossoit dit en passant, je vous mettrai quelques photo de temps en temps
histoire de partager
Si !!venom a écrit : sa ne serais pas tirait des inconnus sa ?![]()
Arg ! Venom !! grrrr!venom a écrit :sa ne serais pas tirait des inconnus sa ?![]()
Un forum sans DOBRO...c'est comme une nuit sans femme !!!
c'est comme la mer sans les vagues
c'est comme les vagues sans l'écume
c'est comme l'écume sans le sel
c'est comme le sel sans le poivre .... Je m'égare là lolllllllllllllll !
je dirais même plus : Un chagrin d'amourça ne serait pas tiré des inconnus ça ?
Code : Tout sélectionner
; 3D-Stars (V. Schmid)
Structure Stars
x3.f
y3.f
z3.f
x2.f
y2.f
range.f
Spr.l
EndStructure
MAX_STARS.l = 1000
Dim Stars.Stars(4, MAX_STARS)
Dim Proj.l(3)
Dim Camera.f(3)
;
Global Counter.f
InitSprite()
InitSprite3D()
InitKeyboard()
InitMouse()
Procedure.f curveValue(actuelle.f, Cible.f, P.f)
If P > 1000.0
P = 1000.0
EndIf
ProcedureReturn (actuelle + ( (Cible - actuelle) * P / 1000.0))
EndProcedure
Camera(1) = 0 ; X
Camera(2) = -600 ; Y
Camera(3) = 2000 ; Z
ZEbene.l = 540
BewegeX.b = 0
BewegeY.b = 0
BewegeZ.b = 10
sWidth = GetSystemMetrics_(#SM_CXSCREEN)
sHeight = GetSystemMetrics_(#SM_CYSCREEN)
hWnd = OpenWindow(1, 0, 0, sWidth, sHeight, "Galaxy", #PB_Window_BorderLess | #PB_Window_ScreenCentered )
OpenWindowedScreen(hWnd,0,0, sWidth, sHeight, 1, 0, 0)
xOffset.l = sWidth / 2
yOffset.l = sHeight / 2
; Blanc
CreateSprite(0, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(0))
Circle(8, 8, 7, RGB(64, 64, 64))
Circle(8, 8, 5, RGB(128, 128, 128))
Circle(8, 8, 3, RGB(192, 192, 192))
Circle(8, 8, 1, RGB(255, 255, 255))
StopDrawing()
CreateSprite3D(0, 0)
; Jaune
CreateSprite(1, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
Circle(8, 8, 7, RGB(64, 64, 12))
Circle(8, 8, 5, RGB(128, 128, 24))
Circle(8, 8, 3, RGB(192, 192, 36))
Circle(8, 8, 1, RGB(255, 255, 48))
StopDrawing()
CreateSprite3D(1, 1)
; Rouge
CreateSprite(2, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(2))
Circle(8, 8, 7, RGB(32, 12, 12))
Circle(8, 8, 5, RGB(64, 24, 24))
Circle(8, 8, 3, RGB(128, 36, 36))
Circle(8, 8, 1, RGB(192, 48, 48))
StopDrawing()
CreateSprite3D(2, 2)
; Orange
CreateSprite(3, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(3))
Circle(8, 8, 7, RGB(64, 32, 12))
Circle(8, 8, 5, RGB(128, 64, 24))
Circle(8, 8, 3, RGB(192, 128, 36))
Circle(8, 8, 1, RGB(255, 192, 48))
StopDrawing()
CreateSprite3D(3, 3)
; Bleu
CreateSprite(4, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(4))
Circle(8, 8, 7, RGB(12, 12, 32))
Circle(8, 8, 5, RGB(24, 24, 64))
Circle(8, 8, 3, RGB(36, 36, 128))
Circle(8, 8, 1, RGB(48, 48, 192))
StopDrawing()
CreateSprite3D(4, 4)
; Violet
CreateSprite(5, 16, 16, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(5))
Circle(8, 8, 7, RGB(64, 12, 64))
Circle(8, 8, 5, RGB(128, 24, 128))
Circle(8, 8, 3, RGB(192, 36, 192))
Circle(8, 8, 1, RGB(255, 48, 255))
StopDrawing()
CreateSprite3D(5, 5)
Angle.f = 0
For i.l = 1 To MAX_STARS
Angle.f + 0.02
RangeX.f = Pow(Angle,1.3)*10
RangeY.f = Pow(Angle,1.3)*15
Stars(0, i)\x3 = Cos(Angle) * 100*angle; + (Random(100) - 50)
Stars(0, i)\z3 = Sin(Angle) * 100*angle; + (Random(100) - 50)
Stars(0, i)\y3 = Random(100) - 50
Stars(0, i)\Range = Sqr(Stars(0, i)\x3 * Stars(0, i)\x3 + Stars(0, i)\z3 * Stars(0, i)\z3 + Stars(0, i)\y3 * Stars(0, i)\y3)
Stars(0, i)\x3 = Cos(Angle) * 100*angle + (Stars(0, i)\Range / 1000 * (Random(100) - 50))
Stars(0, i)\z3 = Sin(Angle) * 100*angle + (Stars(0, i)\Range / 1000 * (Random(100) - 50))
Stars(0, i)\y3 = (Stars(0, i)\Range / 1000 * (Random(100) - 50))
Stars(0, i)\Range = Sqr(Stars(0, i)\x3 * Stars(0, i)\x3 + Stars(0, i)\z3 * Stars(0, i)\z3 + Stars(0, i)\y3 * Stars(0, i)\y3)
Spr = Random(Int(Stars(0, i)\Range / 100))
If Spr < 0 : Spr = 0 : EndIf
If Spr > 5 : Spr = 5 : EndIf
Stars(0, i)\Spr = Spr
Stars(1, i)\x3 = Cos(Angle + #PI / 2) * 100*angle
Stars(1, i)\z3 = Sin(Angle + #PI / 2) * 100*angle
Stars(1, i)\y3 = Random(100) - 50
Stars(1, i)\Range = Sqr(Stars(1, i)\x3 * Stars(1, i)\x3 + Stars(1, i)\z3 * Stars(1, i)\z3 + Stars(1, i)\y3 * Stars(1, i)\y3)
Stars(1, i)\x3 = Cos(Angle + #PI / 2) * 100*angle + (Stars(1, i)\Range / 1000 * (Random(100) - 50))
Stars(1, i)\z3 = Sin(Angle + #PI / 2) * 100*angle + (Stars(1, i)\Range / 1000 * (Random(100) - 50))
Stars(1, i)\y3 = (Stars(1, i)\Range / 1000 * (Random(100) - 50))
Stars(1, i)\Range = Sqr(Stars(1, i)\x3 * Stars(1, i)\x3 + Stars(1, i)\z3 * Stars(1, i)\z3 + Stars(1, i)\y3 * Stars(1, i)\y3)
Spr = Random(Int(Stars(1, i)\Range / 100))
If Spr < 0 : Spr = 0 : EndIf
If Spr > 5 : Spr = 5 : EndIf
Stars(1, i)\Spr = Spr
Stars(2, i)\x3 = Cos(Angle + #PI) * 100*angle
Stars(2, i)\z3 = Sin(Angle + #PI) * 100*angle
Stars(2, i)\y3 = Random(100) - 50
Stars(2, i)\Range = Sqr(Stars(2, i)\x3 * Stars(2, i)\x3 + Stars(2, i)\z3 * Stars(2, i)\z3 + Stars(2, i)\y3 * Stars(2, i)\y3)
Stars(2, i)\x3 = Cos(Angle + #PI) * 100*angle + (Stars(2, i)\Range / 1000 * (Random(100) - 50))
Stars(2, i)\z3 = Sin(Angle + #PI) * 100*angle + (Stars(2, i)\Range / 1000 * (Random(100) - 50))
Stars(2, i)\y3 = (Stars(2, i)\Range / 1000 * (Random(100) - 50))
Stars(2, i)\Range = Sqr(Stars(2, i)\x3 * Stars(2, i)\x3 + Stars(2, i)\z3 * Stars(2, i)\z3 + Stars(2, i)\y3 * Stars(2, i)\y3)
Spr = Random(Int(Stars(2, i)\Range / 100))
If Spr < 0 : Spr = 0 : EndIf
If Spr > 5 : Spr = 5 : EndIf
Stars(2, i)\Spr = Spr
Stars(3, i)\x3 = Cos(Angle + #PI + #PI / 2) * 100*angle
Stars(3, i)\z3 = Sin(Angle + #PI + #PI / 2) * 100*angle
Stars(3, i)\y3 = Random(100) - 50
Stars(3, i)\Range = Sqr(Stars(3, i)\x3 * Stars(3, i)\x3 + Stars(3, i)\z3 * Stars(3, i)\z3 + Stars(3, i)\y3 * Stars(3, i)\y3)
Stars(3, i)\x3 = Cos(Angle + #PI + #PI / 2) * 100*angle + (Stars(3, i)\Range / 1000 * (Random(100) - 50))
Stars(3, i)\z3 = Sin(Angle + #PI + #PI / 2) * 100*angle + (Stars(3, i)\Range / 1000 * (Random(100) - 50))
Stars(3, i)\y3 = (Stars(3, i)\Range / 1000 * (Random(100) - 50))
Stars(3, i)\Range = Sqr(Stars(3, i)\x3 * Stars(3, i)\x3 + Stars(3, i)\z3 * Stars(3, i)\z3 + Stars(3, i)\y3 * Stars(3, i)\y3)
Spr = Random(Int(Stars(3, i)\Range / 100))
If Spr < 0 : Spr = 0 : EndIf
If Spr > 5 : Spr = 5 : EndIf
Stars(3, i)\Spr = Spr
Stars(4, i)\x3 = Random(4000) - 2000
Stars(4, i)\z3 = Random(4000) - 2000
Stars(4, i)\y3 = Random(4000) - 2000
Stars(4, i)\Range = Sqr(Stars(4, i)\x3 * Stars(4, i)\x3 + Stars(4, i)\z3 * Stars(4, i)\z3 + Stars(4, i)\y3 * Stars(4, i)\y3)
Stars(4, i)\Spr = 0
Next
MaxRange.f = Stars(0, MAX_STARS)\Range + 200
Repeat
ClearScreen(RGB(0,0,0))
For i = 1 To MAX_STARS
For g = 0 To 4
Proj(1) = Camera(1) - Stars(g, i)\x3
Proj(2) = Camera(2) - Stars(g, i)\y3
Proj(3) = Camera(3) - Stars(g, i)\z3
Lambda.f = (ZEbene - Stars(g, i)\z3) / Proj(3)
Stars(g, i)\x2 = xOffset + Stars(g, i)\x3 + Lambda * Proj(1) ; X
Stars(g, i)\y2 = yOffset + Stars(g, i)\y3 + Lambda * Proj(2) ; Y
Next
Next
Start3D()
Sprite3DBlendingMode(5, 7)
For i = 1 To MAX_STARS
For g = 0 To 4
Range.f = Pow(Stars(g, i)\Range, 1.003)
Alpha.f = Range.f / MaxRange * 255
pX2 = Stars(g, i)\x2;Random(50) + Random(Range / 4) - Range / 8 - Random(50) + Stars(0, i)\x2
pY2 = Stars(g, i)\y2;Random(50) + Random(Range / 4) - Range / 8 - Random(50) + Stars(0, i)\y2
If g < 4
ZoomSprite3D(Stars(g, i)\Spr, Alpha, Alpha)
DisplaySprite3D(Stars(g, i)\Spr, pX2, pY2, (255 - Alpha) / (Alpha / 8))
Else
Alpha = Stars(4, i)\z3 / 2000
ZoomSprite3D(Stars(4, i)\Spr, Alpha * 16, Alpha * 16)
DisplaySprite3D(Stars(4, i)\Spr, pX2, pY2, Alpha * 255)
EndIf
Next
Next
ExamineKeyboard()
ExamineMouse()
;
If KeyboardPushed(#PB_Key_Up)
BewegeY = 10
Camera(2) = curveValue(Camera(2), 600, 20)
ElseIf KeyboardPushed(#PB_Key_Down)
BewegeY = -10
Camera(2) = curveValue(Camera(2), -600, 20)
Else
;Camera(2) = curveValue(Camera(2), 0, 50)
;BewegeY = 0
EndIf
If KeyboardPushed(#PB_Key_Right)
BewegeX = 10
Camera(1) = curveValue(Camera(1), -600, 20)
ElseIf KeyboardPushed(#PB_Key_Left)
BewegeX = -10
Camera(1) = curveValue(Camera(1), 600, 20)
Else
;Camera(1) = curveValue(Camera(1), 0, 20)
;BewegeX = 0
EndIf
Counter + 0 . 02
If Counter > 2 * #PI : Counter = 0 : EndIf
Camera(1) = Camera(1) + Sin(Counter.f)*10
Camera(2) = Camera(2) + Cos(Counter.f)*10
Camera(3) = Camera(3) + Sin(Counter.f)*10
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or WindowEvent() = #WM_CLOSE
End