Author Topic: COVID-19 in QB64  (Read 6300 times)

0 Members and 1 Guest are viewing this topic.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: COVID-19 in QB64
« Reply #15 on: June 02, 2020, 12:16:12 pm »
WOW @TempodiBasic .

I made some little change in the code so the each virus rotate on its axis.

Code: QB64: [Select]
  1. 'COVID-19 in QB64
  2. 'By Ashish
  3. '1 Jun, 2020
  4. '
  5. 'WARNING:Use mask. Apply santizer after closing the program.
  6. ' 2 Jun, 2020    added a little son of COVID-19  TDB
  7. ' 2 Jun, 2020    modularizing  the _GL actions   TDB
  8. '2 Jun, 2020     an array of virus and a continuous restarting by Enter and quit by Space TDB
  9. '2 Jun, 2020 made the viruses rotate on its axis.
  10. _TITLE "We are all Covid-19 :-)"
  11.  
  12. SCREEN _NEWIMAGE(600, 600, 32)
  13.  
  14.     SUB glutSolidSphere (BYVAL radius AS DOUBLE, BYVAL slices AS LONG, BYVAL stack AS LONG)
  15.     SUB gluLookAt (BYVAL eyeX#, BYVAL eyeY#, BYVAL eyeZ#, BYVAL centerX#, BYVAL centerY#, BYVAL centerZ#, BYVAL upX#, BYVAL upY#, BYVAL upZ#)
  16.  
  17. DIM SHARED glAllow AS _BYTE
  18. TYPE vec3
  19.     x AS SINGLE
  20.     y AS SINGLE
  21.     z AS SINGLE
  22. TYPE colorRGBA
  23.     R AS SINGLE
  24.     G AS SINGLE
  25.     B AS SINGLE
  26.     A AS SINGLE
  27.  
  28. TYPE COVID19
  29.     POS AS vec3
  30.     r AS SINGLE
  31.     rotY AS SINGLE
  32.     rotX AS SINGLE
  33.     Vxz AS SINGLE
  34.     Vyz AS SINGLE
  35.     C AS colorRGBA
  36.  
  37. DIM SHARED virus(1 TO 10) AS COVID19
  38. Initialize
  39.     k = _KEYHIT
  40.     LOCATE 1, 1: PRINT "Space to quit, Enter to change viruses"
  41.     _LIMIT 1
  42.     IF k = 13 THEN Initialize
  43. LOOP UNTIL k = 32
  44. END ' a logical end to the flow
  45.  
  46. '------------ SUBs and FUNCTIONs----------------------------
  47. SUB Initialize
  48.     FOR z = 1 TO 10 STEP 1
  49.         virus(z).r = 0.1 + (RND / 5)
  50.         virus(z).POS.y = 1 - (RND * 2)
  51.         virus(z).POS.x = 1 - (RND * 2)
  52.         virus(z).POS.z = 1 - (RND * 2) 'virus(z).POS.z = 0
  53.         virus(z).Vxz = 20 - (RND * 10)
  54.         virus(z).Vyz = 20 - (RND * 10)
  55.         virus(z).C.R = 1 - (RND * 1)
  56.         virus(z).C.G = 1 - (RND * 1)
  57.         virus(z).C.B = 1 - (RND * 1)
  58.         virus(z).C.A = 1 - (RND * 1)
  59.     NEXT z
  60.     glAllow = -1
  61.  
  62.  
  63. SUB InitGL (in, aspe)
  64.     IF in = 0 THEN
  65.         in = 1
  66.         aspe = _WIDTH / _HEIGHT
  67.         _glViewport 0, 0, _WIDTH, _HEIGHT
  68.     END IF
  69.  
  70. SUB DrawLines (viru AS COVID19)
  71.     _glColor3f 1, 0, 0
  72.     _glBegin _GL_LINES
  73.     FOR phi = 0.4 TO _PI(2) STEP .5
  74.         FOR theta = 0.3 TO _PI STEP .5
  75.             _glVertex3f viru.r * SIN(theta) * COS(phi), viru.r * SIN(theta) * SIN(phi), viru.r * COS(theta)
  76.             _glVertex3f (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  77.         NEXT
  78.     NEXT
  79.     _glEnd
  80.  
  81.  
  82. SUB DrawPoints (viru AS COVID19)
  83.     _glBegin _GL_POINTS
  84.     FOR phi = 0.4 TO _PI(2) STEP .5
  85.         FOR theta = 0.3 TO _PI STEP .5
  86.             _glVertex3f (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  87.         NEXT
  88.     NEXT
  89.     _glEnd
  90.  
  91. SUB DrawVirus (v AS COVID19)
  92.     _glPushMatrix 'save the previous position & rotation
  93.     ' setting  position and rotation
  94.     _glTranslatef v.POS.x, v.POS.y, v.POS.z
  95.     _glRotatef v.rotY, 0.5, 1, 0
  96.     v.rotY = v.rotY + 2
  97.  
  98.     _glEnable _GL_LIGHTING ' thanks to Ashish
  99.     _glMaterialfv _GL_FRONT_AND_BACK, _GL_DIFFUSE, glVec4(v.C.R, v.C.G, v.C.B, v.C.A)
  100.  
  101.     ' make the sphere
  102.     glutSolidSphere v.r, v.Vxz, v.Vyz
  103.  
  104.     _glDisable _GL_LIGHTING
  105.     ' make lines
  106.     DrawLines v
  107.     ' make points
  108.     DrawPoints v
  109.     _glEnable _GL_LIGHTING
  110.  
  111.     _glPopMatrix 'restore the original position & rotation
  112.  
  113. SUB _GL ()
  114.     STATIC init, aspect
  115.  
  116.     IF glAllow = 0 THEN EXIT SUB
  117.  
  118.     InitGL init, aspect
  119.  
  120.     _glEnable _GL_DEPTH_TEST
  121.     _glEnable _GL_LIGHTING
  122.     _glEnable _GL_LIGHT0
  123.  
  124.     _glLightfv _GL_LIGHT0, _GL_AMBIENT, glVec4(0.0, 0.0, 0.0, 1)
  125.     _glLightfv _GL_LIGHT0, _GL_DIFFUSE, glVec4(0.8, 0.8, 0.8, 1)
  126.     _glLightfv _GL_LIGHT0, _GL_SPECULAR, glVec4(1, 1, 1, 1)
  127.     _glLightfv _GL_LIGHT0, _GL_POSITION, glVec4(0, 0, 10, 1)
  128.  
  129.  
  130.  
  131.     _glMatrixMode _GL_PROJECTION
  132.     _gluPerspective 50, aspect, 0.1, 10
  133.  
  134.     _glMatrixMode _GL_MODELVIEW
  135.     gluLookAt 0, 0, 3, 0, 0, 0, 0, 1, 0
  136.  
  137.     _glLineWidth 2.0
  138.     _glPointSize 10.0
  139.     FOR z = 1 TO 10 STEP 1
  140.         DrawVirus virus(z)
  141.     NEXT z
  142.  
  143.  
  144. FUNCTION glVec4%& (x, y, z, w) 'give the offset of the given vector
  145.     STATIC internal_vec4(3)
  146.     internal_vec4(0) = x
  147.     internal_vec4(1) = y
  148.     internal_vec4(2) = z
  149.     internal_vec4(3) = w
  150.     glVec4%& = _OFFSET(internal_vec4())
  151.  
  152.  


PS : Can you make the coronavirus rain? :P
« Last Edit: June 02, 2020, 12:17:17 pm by Ashish »
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: COVID-19 in QB64
« Reply #16 on: June 02, 2020, 01:09:23 pm »
Hi Ashish
I find this to rain viruses

Code: QB64: [Select]
  1. 'COVID-19 in QB64
  2. 'By Ashish
  3. '1 Jun, 2020
  4. '
  5. 'WARNING:Use mask. Apply santizer after closing the program.
  6. ' 2 Jun, 2020    added a little son of COVID-19  TDB
  7. ' 2 Jun, 2020    modularizing  the _GL actions   TDB
  8. '2 Jun, 2020     an array of virus and a continuous restarting by Enter and quit by Space TDB
  9. '2 Jun, 2020 made the viruses rotate on its axis.
  10. _TITLE "We are all Covid-19 :-)"
  11.  
  12. SCREEN _NEWIMAGE(600, 600, 32)
  13.  
  14.     SUB glutSolidSphere (BYVAL radius AS DOUBLE, BYVAL slices AS LONG, BYVAL stack AS LONG)
  15.     SUB gluLookAt (BYVAL eyeX#, BYVAL eyeY#, BYVAL eyeZ#, BYVAL centerX#, BYVAL centerY#, BYVAL centerZ#, BYVAL upX#, BYVAL upY#, BYVAL upZ#)
  16.  
  17. DIM SHARED glAllow AS _BYTE
  18. TYPE vec3
  19.     x AS SINGLE
  20.     y AS SINGLE
  21.     z AS SINGLE
  22. TYPE colorRGBA
  23.     R AS SINGLE
  24.     G AS SINGLE
  25.     B AS SINGLE
  26.     A AS SINGLE
  27.  
  28. TYPE COVID19
  29.     POS AS vec3
  30.     r AS SINGLE
  31.     rotY AS SINGLE
  32.     rotX AS SINGLE
  33.     Vxz AS SINGLE
  34.     Vyz AS SINGLE
  35.     C AS colorRGBA
  36.  
  37. DIM SHARED virus(1 TO 10) AS COVID19
  38. Initialize
  39.     k = _KEYHIT
  40.     LOCATE 1, 1: PRINT "Space to quit, Enter to change viruses"
  41.     _LIMIT 1
  42.     IF k = 13 THEN Initialize
  43. LOOP UNTIL k = 32
  44. END ' a logical end to the flow
  45.  
  46. '------------ SUBs and FUNCTIONs----------------------------
  47.  
  48. SUB Initialize
  49.     FOR z = 1 TO 10 STEP 1
  50.         virus(z).r = 0.1 + (RND / 5)
  51.         virus(z).POS.y = 1 - (RND * 2)
  52.         virus(z).POS.x = 1 - (RND * 2)
  53.         virus(z).POS.z = 1 - (RND * 2) 'virus(z).POS.z = 0
  54.         virus(z).Vxz = 20 - (RND * 10)
  55.         virus(z).Vyz = 20 - (RND * 10)
  56.         virus(z).C.R = 1 - (RND * 1)
  57.         virus(z).C.G = 1 - (RND * 1)
  58.         virus(z).C.B = 1 - (RND * 1)
  59.         virus(z).C.A = 1 - (RND * 1)
  60.     NEXT z
  61.     glAllow = -1
  62.  
  63.  
  64. SUB InitGL (in, aspe)
  65.     IF in = 0 THEN
  66.         in = 1
  67.         aspe = _WIDTH / _HEIGHT
  68.         _glViewport 0, 0, _WIDTH, _HEIGHT
  69.     END IF
  70.  
  71. SUB DrawLines (viru AS COVID19)
  72.     _glColor3f 1, 0, 0
  73.     _glBegin _GL_LINES
  74.     FOR phi = 0.4 TO _PI(2) STEP .5
  75.         FOR theta = 0.3 TO _PI STEP .5
  76.             _glVertex3f viru.r * SIN(theta) * COS(phi), viru.r * SIN(theta) * SIN(phi), viru.r * COS(theta)
  77.             _glVertex3f (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  78.         NEXT
  79.     NEXT
  80.     _glEnd
  81.  
  82.  
  83. SUB DrawPoints (viru AS COVID19)
  84.     _glBegin _GL_POINTS
  85.     FOR phi = 0.4 TO _PI(2) STEP .5
  86.         FOR theta = 0.3 TO _PI STEP .5
  87.             _glVertex3f (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  88.         NEXT
  89.     NEXT
  90.     _glEnd
  91.  
  92. SUB DrawVirus (v AS COVID19)
  93.     ' raining effect
  94.     v.POS.y = v.POS.y - 0.02
  95.     IF v.POS.y <= -1 THEN v.POS.y = 1
  96.  
  97.     _glPushMatrix 'save the previous position & rotation
  98.     ' setting  position and rotation
  99.     _glTranslatef v.POS.x, v.POS.y, v.POS.z
  100.     _glRotatef v.rotY, 0.5, 1, 0
  101.     v.rotY = v.rotY + 2
  102.  
  103.     _glEnable _GL_LIGHTING ' thanks to Ashish
  104.     _glMaterialfv _GL_FRONT_AND_BACK, _GL_DIFFUSE, glVec4(v.C.R, v.C.G, v.C.B, v.C.A)
  105.  
  106.     ' make the sphere
  107.     glutSolidSphere v.r, v.Vxz, v.Vyz
  108.  
  109.     _glDisable _GL_LIGHTING
  110.     ' make lines
  111.     DrawLines v
  112.     ' make points
  113.     DrawPoints v
  114.     _glEnable _GL_LIGHTING
  115.  
  116.     _glPopMatrix 'restore the original position & rotation
  117.  
  118. SUB _GL ()
  119.     STATIC init, aspect
  120.  
  121.     IF glAllow = 0 THEN EXIT SUB
  122.  
  123.     InitGL init, aspect
  124.  
  125.     _glEnable _GL_DEPTH_TEST
  126.     _glEnable _GL_LIGHTING
  127.     _glEnable _GL_LIGHT0
  128.  
  129.     _glLightfv _GL_LIGHT0, _GL_AMBIENT, glVec4(0.0, 0.0, 0.0, 1)
  130.     _glLightfv _GL_LIGHT0, _GL_DIFFUSE, glVec4(0.8, 0.8, 0.8, 1)
  131.     _glLightfv _GL_LIGHT0, _GL_SPECULAR, glVec4(1, 1, 1, 1)
  132.     _glLightfv _GL_LIGHT0, _GL_POSITION, glVec4(0, 0, 10, 1)
  133.  
  134.  
  135.  
  136.     _glMatrixMode _GL_PROJECTION
  137.     _gluPerspective 50, aspect, 0.1, 10
  138.  
  139.     _glMatrixMode _GL_MODELVIEW
  140.     gluLookAt 0, 0, 3, 0, 0, 0, 0, 1, 0
  141.  
  142.     _glLineWidth 2.0
  143.     _glPointSize 10.0
  144.     FOR z = 1 TO 10 STEP 1
  145.         DrawVirus virus(z)
  146.     NEXT z
  147.     _glFlush
  148.  
  149.  
  150. FUNCTION glVec4%& (x, y, z, w) 'give the offset of the given vector
  151.     STATIC internal_vec4(3)
  152.     internal_vec4(0) = x
  153.     internal_vec4(1) = y
  154.     internal_vec4(2) = z
  155.     internal_vec4(3) = w
  156.     glVec4%& = _OFFSET(internal_vec4())
  157.  

simple I put at start of DrawVirus these lines of code

Quote
   ' raining effect
    v.POS.y = v.POS.y - 0.02
    IF v.POS.y <= -1 THEN v.POS.y = 1

Thanks for the suggestion
Programming isn't difficult, only it's  consuming time and coffee

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: COVID-19 in QB64
« Reply #17 on: June 02, 2020, 11:34:46 pm »
Amazing work, @TempodiBasic :)
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline qbkiller101

  • Newbie
  • Posts: 73
    • View Profile
Re: COVID-19 in QB64
« Reply #18 on: June 03, 2020, 01:44:49 am »
@TempodiBasic tried opening a zillion times but still
 
Capture.PNG

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: COVID-19 in QB64
« Reply #19 on: June 03, 2020, 02:20:57 am »
@qbkiller101
Add this before _SCREENMOVE _MIDDLE on line 44.

Code: QB64: [Select]
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline qbkiller101

  • Newbie
  • Posts: 73
    • View Profile
Re: COVID-19 in QB64
« Reply #20 on: June 03, 2020, 02:23:50 am »
worked.
@TempodiBasic enter to quit isnt working

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: COVID-19 in QB64
« Reply #21 on: June 03, 2020, 02:34:58 am »
@qbkiller101 First of all, it is space to quite.

secondly, It may be working but it will be delay since the loop is completing its one cycle in one second, this is because of _LIMIT 1.
Change _LIMIT 1 to _LIMIT 30.

Here's the updated code with all glitch fixed.

Code: QB64: [Select]
  1.     'COVID-19 in QB64
  2.     'By Ashish
  3.     '1 Jun, 2020
  4.     '
  5.     'WARNING:Use mask. Apply santizer after closing the program.
  6.     ' 2 Jun, 2020    added a little son of COVID-19  TDB
  7.     ' 2 Jun, 2020    modularizing  the _GL actions   TDB
  8.     '2 Jun, 2020     an array of virus and a continuous restarting by Enter and quit by Space TDB
  9.     '2 Jun, 2020 made the viruses rotate on its axis.
  10.     _TITLE "We are all Covid-19 :-)"
  11.      
  12.     SCREEN _NEWIMAGE(600, 600, 32)
  13.      
  14.         SUB glutSolidSphere (BYVAL radius AS DOUBLE, BYVAL slices AS LONG, BYVAL stack AS LONG)
  15.         SUB gluLookAt (BYVAL eyeX#, BYVAL eyeY#, BYVAL eyeZ#, BYVAL centerX#, BYVAL centerY#, BYVAL centerZ#, BYVAL upX#, BYVAL upY#, BYVAL upZ#)
  16.     END DECLARE
  17.      
  18.     DIM SHARED glAllow AS _BYTE
  19.     TYPE vec3
  20.         x AS SINGLE
  21.         y AS SINGLE
  22.         z AS SINGLE
  23.     END TYPE
  24.     TYPE colorRGBA
  25.         R AS SINGLE
  26.         G AS SINGLE
  27.         B AS SINGLE
  28.         A AS SINGLE
  29.     END TYPE
  30.      
  31.     TYPE COVID19
  32.         POS AS vec3
  33.         r AS SINGLE
  34.         rotY AS SINGLE
  35.         rotX AS SINGLE
  36.         Vxz AS SINGLE
  37.         Vyz AS SINGLE
  38.         C AS colorRGBA
  39.     END TYPE
  40.      
  41.     DIM SHARED virus(1 TO 10) AS COVID19
  42.     Initialize
  43.     DO
  44.         k = _KEYHIT
  45.         LOCATE 1, 1: PRINT "Space to quit, Enter to change viruses"
  46.         _LIMIT 30
  47.         IF k = 13 THEN Initialize
  48.     LOOP UNTIL k = 32
  49.     END ' a logical end to the flow
  50.      
  51.     '------------ SUBs and FUNCTIONs----------------------------
  52.      
  53.     SUB Initialize
  54.         FOR z = 1 TO 10 STEP 1
  55.             virus(z).r = 0.1 + (RND / 5)
  56.             virus(z).POS.y = 1 - (RND * 2)
  57.             virus(z).POS.x = 1 - (RND * 2)
  58.             virus(z).POS.z = 1 - (RND * 2) 'virus(z).POS.z = 0
  59.             virus(z).Vxz = 20 - (RND * 10)
  60.             virus(z).Vyz = 20 - (RND * 10)
  61.             virus(z).C.R = 1 - (RND * 1)
  62.             virus(z).C.G = 1 - (RND * 1)
  63.             virus(z).C.B = 1 - (RND * 1)
  64.             virus(z).C.A = 1 - (RND * 1)
  65.         NEXT z
  66.         glAllow = -1
  67.     END SUB
  68.      
  69.      
  70.     SUB InitGL (in, aspe)
  71.         IF in = 0 THEN
  72.             in = 1
  73.             aspe = _WIDTH / _HEIGHT
  74.             _GLVIEWPORT 0, 0, _WIDTH, _HEIGHT
  75.         END IF
  76.     END SUB
  77.      
  78.     SUB DrawLines (viru AS COVID19)
  79.         _GLCOLOR3F 1, 0, 0
  80.         _GLBEGIN _GL_LINES
  81.         FOR phi = 0.4 TO _PI(2) STEP .5
  82.             FOR theta = 0.3 TO _PI STEP .5
  83.                 _GLVERTEX3F viru.r * SIN(theta) * COS(phi), viru.r * SIN(theta) * SIN(phi), viru.r * COS(theta)
  84.                 _GLVERTEX3F (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  85.             NEXT
  86.         NEXT
  87.         _GLEND
  88.      
  89.     END SUB
  90.      
  91.     SUB DrawPoints (viru AS COVID19)
  92.         _GLBEGIN _GL_POINTS
  93.         FOR phi = 0.4 TO _PI(2) STEP .5
  94.             FOR theta = 0.3 TO _PI STEP .5
  95.                 _GLVERTEX3F (0.1 + viru.r) * SIN(theta) * COS(phi), (0.1 + viru.r) * SIN(theta) * SIN(phi), (0.1 + viru.r) * COS(theta)
  96.             NEXT
  97.         NEXT
  98.         _GLEND
  99.     END SUB
  100.      
  101.     SUB DrawVirus (v AS COVID19)
  102.         ' raining effect
  103.         v.POS.y = v.POS.y - 0.02
  104.         IF v.POS.y <= -1 THEN v.POS.y = 1
  105.      
  106.         _GLPUSHMATRIX 'save the previous position & rotation
  107.         ' setting  position and rotation
  108.         _GLTRANSLATEF v.POS.x, v.POS.y, v.POS.z
  109.         _GLROTATEF v.rotY, 0.5, 1, 0
  110.         v.rotY = v.rotY + 2
  111.      
  112.         _GLENABLE _GL_LIGHTING ' thanks to Ashish
  113.         _GLMATERIALFV _GL_FRONT_AND_BACK, _GL_DIFFUSE, glVec4(v.C.R, v.C.G, v.C.B, v.C.A)
  114.      
  115.         ' make the sphere
  116.         glutSolidSphere v.r, v.Vxz, v.Vyz
  117.      
  118.         _GLDISABLE _GL_LIGHTING
  119.         ' make lines
  120.         DrawLines v
  121.         ' make points
  122.         DrawPoints v
  123.         _GLENABLE _GL_LIGHTING
  124.      
  125.         _GLPOPMATRIX 'restore the original position & rotation
  126.     END SUB
  127.      
  128.     SUB _GL ()
  129.         STATIC init, aspect
  130.      
  131.         IF glAllow = 0 THEN EXIT SUB
  132.      
  133.         InitGL init, aspect
  134.      
  135.         _GLENABLE _GL_DEPTH_TEST
  136.         _GLENABLE _GL_LIGHTING
  137.         _GLENABLE _GL_LIGHT0
  138.      
  139.         _GLLIGHTFV _GL_LIGHT0, _GL_AMBIENT, glVec4(0.0, 0.0, 0.0, 1)
  140.         _GLLIGHTFV _GL_LIGHT0, _GL_DIFFUSE, glVec4(0.8, 0.8, 0.8, 1)
  141.         _GLLIGHTFV _GL_LIGHT0, _GL_SPECULAR, glVec4(1, 1, 1, 1)
  142.         _GLLIGHTFV _GL_LIGHT0, _GL_POSITION, glVec4(0, 0, 10, 1)
  143.      
  144.      
  145.      
  146.         _GLMATRIXMODE _GL_PROJECTION
  147.         _GLUPERSPECTIVE 50, aspect, 0.1, 10
  148.      
  149.         _GLMATRIXMODE _GL_MODELVIEW
  150.         gluLookAt 0, 0, 3, 0, 0, 0, 0, 1, 0
  151.      
  152.         _GLLINEWIDTH 2.0
  153.         _GLPOINTSIZE 10.0
  154.         FOR z = 1 TO 10 STEP 1
  155.             DrawVirus virus(z)
  156.         NEXT z
  157.         _GLFLUSH
  158.     END SUB
  159.      
  160.      
  161.     FUNCTION glVec4%& (x, y, z, w) 'give the offset of the given vector
  162.         STATIC internal_vec4(3)
  163.         internal_vec4(0) = x
  164.         internal_vec4(1) = y
  165.         internal_vec4(2) = z
  166.         internal_vec4(3) = w
  167.         glVec4%& = _OFFSET(internal_vec4())
  168.      
  169.  
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline qbkiller101

  • Newbie
  • Posts: 73
    • View Profile
Re: COVID-19 in QB64
« Reply #22 on: June 03, 2020, 02:37:16 am »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: COVID-19 in QB64
« Reply #23 on: June 03, 2020, 04:27:33 am »
@qbkiller101
 yes that issue is alternating on my Notebook, and think that Window Defender has trolled me lanching a warning of a Troian blabla C.cl! in the file compiled! But after some google research I have found so many different source for that warning of windows defender! :-))

the issue has been already fixed by Ashish.
The not immediate response of program to the keyboard is the low cycle of run (_LIMIT 1), as Ashish has stressed if you want a program with  more performance you must arise that _LIMIT.
Thanks to try.

@Ashish
Thanks for appreciations, and moreover thanks to having teached me _SCREENEXISTS that I don't know.
If I have time today I go on with Mask tutorial and the rest.

Good Coding
Programming isn't difficult, only it's  consuming time and coffee

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 316
  • Needle nardle noo. - Peter Sellers
    • View Profile
Re: COVID-19 in QB64
« Reply #24 on: July 13, 2020, 12:19:49 am »
Neato-o, but it frequently freezes on startup for me because of the _SCREENMOVE _MIDDLE.
Commenting that out, or adding a _DELAY .5 after it, fixes it.

It works better if you plug it in.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: COVID-19 in QB64
« Reply #25 on: July 13, 2020, 01:58:44 pm »
Yes you're right and your modifications are a workaround while this is the solution
https://www.qb64.org/forum/index.php?topic=2652.msg118726#msg118726
Thanks to try code
Programming isn't difficult, only it's  consuming time and coffee