Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Fortran/f90gl-1.2.15/examples/   (NIST Fortran ©)  Datei vom 6.0.2003 mit Größe 1 kB image not shown  

Quelle  sphere.f90   Sprache: Fortran

 
!  GLUT Fortran 90 program to draw red light sphere.

        subroutine display
        use opengl_gl
        use opengl_glut
        call glclear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT)
        call glcalllist(1)
        call glutswapbuffers
        end

        subroutine gfxinit
        use opengl_gl
        use opengl_glu
        use opengl_glut
        real(glfloat) :: diffuse(4) = (/1.0, 0.0, 0.0, 1.0/),  &
                            pos(4)     = (/1.0, 1.0, 1.0, 0.0/)
        call glnewlist(1, GL_COMPILE)
        call glutsolidsphere(1.0_gldouble, 20, 20)
        call glendlist
        call gllightfv(GL_LIGHT0, GL_DIFFUSE, diffuse)
        call gllightfv(GL_LIGHT0, GL_POSITION, pos)
        call glenable(GL_LIGHTING)
        call glenable(GL_LIGHT0)
        call glenable(GL_DEPTH_TEST)
        call glmatrixmode(GL_PROJECTION)
        call gluperspective(40.0_gldouble, 1.0_gldouble, &
                             1.0_gldouble, 10.0_gldouble)
        call glmatrixmode(GL_MODELVIEW)
        call glulookat( &
                  0.0_gldouble, 0.0_gldouble, 5.0_gldouble, &
                  0.0_gldouble, 0.0_gldouble, 0.0_gldouble, &
                  0.0_gldouble, 1.0_gldouble, 1.0_gldouble)
        call gltranslatef(0.0, 0.0, -1.0)
        end

        program main
        use opengl_glut
        interface
          subroutine display()
          end subroutine display
        end interface
        call glutinit
        call glutinitdisplaymode(GLUT_DOUBLE+GLUT_RGB+GLUT_DEPTH)
        i = glutcreatewindow('Fortran GLUT sphere')
        call gfxinit
        call glutdisplayfunc(display)
        call glutmainloop
        end

97%


¤ Dauer der Verarbeitung: 0.8 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.