Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => The "Geek" corner => Topic started by: Patrice Terrier on October 16, 2008, 09:26:19 PM

Title: MagicBall (OpenGL layered animation)
Post by: Patrice Terrier on October 16, 2008, 09:26:19 PM
Move the ball to the screen location you want, preferably over a dark background but it looks good also on a lighter one.

Try changing this to see the result:

FUNCTION GLsphere() AS LONG
    LOCAL K, Done, ListSphere AS LONG, sBuf AS STRING
    LOCAL s1, s2, s3, edge AS SINGLE

    '// Load the sphere mesh
    ListSphere = glGenLists(1)
    CALL glNewlist(ListSphere, %GL_COMPILE)
    DO WHILE Done = 0
       INCR K
       sBuf = LTRIM$(Bufin("Encounter.bbm", Done))
       IF ASC(LTRIM$(sBuf)) = 39 THEN sBuf = "" ' "'"
       IF LEN(sBuf) THEN

          IF (K mod 8) = 0 THEN ' <--- Change to either 8, 11, 13, 15, 21
             s1 = VAL(PARSE$(sBuf, 1))
             s2 = VAL(PARSE$(sBuf, 2))
             s3 = VAL(PARSE$(sBuf, 3))
             CALL glVertex3f(s1, s2, s3)

             CALL glPushMatrix()
                edge = 0.15
                CALL glBegin(%GL_QUADS)
                   CALL glTexCoord2f(0.0, 0.0): CALL glVertex3f(-edge + s1,-edge + s2, s3)
                   CALL glTexCoord2f(1.0, 0.0): CALL glVertex3f( edge + s1,-edge + s2, s3)
                   CALL glTexCoord2f(1.0, 1.0): CALL glVertex3f( edge + s1, edge + s2, s3)
                   CALL glTexCoord2f(0.0, 1.0): CALL glVertex3f(-edge + s1, edge + s2, s3)
                CALL glEnd()
             CALL glPopMatrix()

          END IF

       END IF
    LOOP

    CALL glEndList()
    FUNCTION = ListSphere
END FUNCTION


...
Title: Re: MagicBall (OpenGL layered animation)
Post by: Patrice Terrier on February 12, 2009, 11:50:51 AM
Jürgen

The way you coded your Macig2.zip demo would cause major issue when running on VISTA with the UAC mode enabled.

...
Title: Re: MagicBall (OpenGL layered animation)
Post by: Patrice Terrier on August 09, 2011, 09:53:07 AM
The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".

...