Page 1 sur 1

Cercle abstrait pour test en OpenGL

Publié : lun. 27/nov./2023 23:47
par threedslider
Voici un nouveau code :mrgreen:

Code : Tout sélectionner

;;;
;;;  Created by threedslider -- 11/27/2023
;;;

InitSprite()
InitKeyboard()


OpenWindow(0, 0, 0, 800, 600, "OpenGL : Abstract Circle for test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)


glMatrixMode_(#GL_PROJECTION)
glLoadIdentity_() 
gluPerspective_(45.0, 800/600, 1.0, 60.0)
glMatrixMode_(#GL_MODELVIEW)
glTranslatef_(0, 0, -50)
glShadeModel_(#GL_SMOOTH)
glEnable_(#GL_LIGHT0)
glEnable_(#GL_LIGHTING)
glEnable_(#GL_COLOR_MATERIAL)
glEnable_(#GL_DEPTH_TEST)
glEnable_(#GL_CULL_FACE)   
glViewport_(0, 0, 800, 600)

x.i = 0

Repeat
glClearColor_(0.1, 0.1, 0.1, 0) ; background color
  glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
  Repeat
    event = WindowEvent()
    Select Event
      Case #PB_Event_CloseWindow
        quit = 1
     EndSelect
   Until event = 0
   
    
    For x = 0 To 360
    
    move.f  +  1/100000
    
      wave_x.f =  Cos(move- x + Sin(move+x)) * 50 *Exp((Cos(x))/50) * Cos(move+Cos(x))
      
      wave_y.f =  Sin(move+ x + Cos(move-x)) * 50 *Exp((Sin(-x))/50) * Sin(move+x)
     
          
    glBegin_(#GL_POINTS)
    glColor3f_(1.0, 0.3, 1.0)
    glVertex3f_( wave_x*0.3, wave_y*0.3, 0.3) 
    
    glEnd_();
    
    glPointSize_(3.0)
         
  Next
  
  If x = 360
    x = 0
  EndIf
  
   
 FlipBuffers()
 
 ExamineKeyboard()
 
Until KeyboardPushed(#PB_Key_Escape) Or quit = 1


Re: Cercle abstrait pour test en OpenGL

Publié : mar. 28/nov./2023 8:33
par SPH
Tu t'améliores. Continue ... 👌

PS : tu as un email de ma part 🙏

Re: Cercle abstrait pour test en OpenGL

Publié : mar. 28/nov./2023 12:20
par threedslider
Merci beaucoup !