Page 1 sur 1

Hélix en animation 3D (Fake !?)

Publié : mar. 16/mai/2023 11:56
par threedslider
Voici un Hélix fait en animation 3D ! (sans les coordonnées en 3D) :mrgreen:

Code : Tout sélectionner

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Coded with Purebasic v.6.0 by threedslider 15/05/2023
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Test for Helix in fake 3D :)


InitSprite()
InitKeyboard()

OpenWindow(1, 0,0,800,600,"Helix", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
SetFrameRate(30)



Repeat
  ExamineKeyboard()
  event = WindowEvent()
  ClearScreen(RGB(0,0,0))
  
  StartDrawing(ScreenOutput())
  For x = 0 To 360
    
    move.f  +  1/10000
    
      helix_x.f =  100 *Cos(move+x) 
      
      helix_y.f =  10 *(move-x)
     
      Box( helix_x+400, helix_y, 5, 5, RGB(255, 0, 0) )
      
    
         
  Next
    
  StopDrawing()
  
  
  Delay(1) : FlipBuffers()
  
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End
Enjoy and Happy coding !

Re: Hélix en animation 3D (Fake !?)

Publié : mer. 17/mai/2023 6:49
par threedslider
Un autre code mais cette fois ci un wave 8)

Code : Tout sélectionner

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Coded with Purebasic v.6.0 by threedslider 17/05/2023
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

InitSprite()
InitKeyboard()

OpenWindow(1, 0,0,800,600,"Wave", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
SetFrameRate(30)



Repeat
  ExamineKeyboard()
  event = WindowEvent()
  ClearScreen(RGB(0,0,0))
  
  StartDrawing(ScreenOutput())
  For x = 0 To 360
    
    move.f  +  1/10000
    
      helix_x.f =  100 *Cos(move+x) 
      
      helix_y.f =  100 *(move-x)
     
      Box( helix_x+400, helix_y, 5, 5, RGB(255, 0, 0) )
      
    
         
  Next
    
  StopDrawing()
  
  
  Delay(1) : FlipBuffers()
  
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End

Re: Hélix en animation 3D (Fake !?)

Publié : mer. 17/mai/2023 22:41
par boddhi
Sympa :wink:

Manque plus que des sprites feuilles mortes ou papillons :mrgreen:

Re: Hélix en animation 3D (Fake !?)

Publié : dim. 10/sept./2023 6:23
par threedslider
boddhi a écrit : mer. 17/mai/2023 22:41 Sympa :wink:

Manque plus que des sprites feuilles mortes ou papillons :mrgreen:
Merci ! Et désolé pour le retard comme réponse ^^

Voici un Hélix qui ressemble et qui crée des chromosome :) (Simulation)

Code : Tout sélectionner

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Coded with Purebasic v.6.02 by threedslider 10/09/2023
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Test for Helix  :)


InitSprite()
InitKeyboard()

OpenWindow(1, 0,0,800,600,"Helix", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
SetFrameRate(30)



Repeat
  ExamineKeyboard()
  event = WindowEvent()
  ClearScreen(RGB(0,0,0))
  
  StartDrawing(ScreenOutput())
  For x = 0 To 360
    
    move.f  +  1/10000
    
      helix_x.f =  5 *Cos(move+x)
      
      helix_y.f =  5 *(move-x)
     
      Box( Exp(helix_x)+400, helix_y, 5, 5, RGB(255, 0, 0) )
      
    
         
  Next
    
  StopDrawing()
  
  
  Delay(1) : FlipBuffers()
  
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End
Voilà enjoy et happy coding !

Re: Hélix en animation 3D (Fake !?)

Publié : dim. 10/sept./2023 17:18
par boddhi
Sympa l'effet :|

Re: Hélix en animation 3D (Fake !?)

Publié : ven. 03/nov./2023 13:16
par threedslider
Merci boddhi :)