Author Topic: Monolith  (Read 3556 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Monolith
« on: December 10, 2020, 10:54:56 pm »
I didn't know the Monolith craze would be all over the world so quickly, so I decided to make a computer one. It uses the neon. Check out the photo too.

Code: QB64: [Select]
  1. _TITLE "Monolith"
  2. SCREEN _NEWIMAGE(800, 600, 32)
  3.  
  4. TYPE vec2
  5.     x AS SINGLE
  6.     y AS SINGLE
  7.  
  8. REDIM SHARED vert(4024) AS vec2, max_v_index
  9. DIM SHARED rFactor!, gFactor!, bFactor!
  10. rFactor! = .25: gFactor! = .25: bFactor! = .5
  11.  
  12.  
  13.  
  14.  
  15. FOR yy = 100 TO 500
  16.     max_v_index = max_v_index + .15
  17.     vert(max_v_index).x = 450
  18.     vert(max_v_index).y = yy
  19. NEXT yy
  20.  
  21. FOR t = 1 TO 360 STEP .05
  22.     cx = (SIN(t) * 300) + 450
  23.     cy = (COS(t) * 300) + 800
  24.     max_v_index = max_v_index + .065
  25.     vert(max_v_index).x = cx
  26.     vert(max_v_index).y = cy
  27.  
  28.  
  29.  
  30.  
  31. SUB _GL ()
  32.     STATIC glInit
  33.     IF glInit = 0 THEN
  34.         glInit = 1
  35.     END IF
  36.     _glViewport -50, -50, _WIDTH, _HEIGHT
  37.     'set the gl screen so that it can work normal screen coordinates
  38.     _glTranslatef -1, 1, 0
  39.     _glScalef 1 / 400, -1 / 300, 1
  40.  
  41.     _glEnable _GL_BLEND
  42.  
  43.     _glBlendFunc _GL_SRC_ALPHA, _GL_ONE
  44.     _glEnableClientState _GL_VERTEX_ARRAY
  45.     _glVertexPointer 2, _GL_FLOAT, 0, _OFFSET(vert())
  46.     FOR j = 60 TO 80
  47.         _glColor4f rFactor!, gFactor!, bFactor!, 0.015
  48.         _glPointSize j
  49.         _glDrawArrays _GL_POINTS, 10, max_v_index
  50.     NEXT
  51.     _glFlush
  52.  
My Monolith.png
* My Monolith.png (Filesize: 43.26 KB, Dimensions: 800x623, Views: 176)

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Monolith
« Reply #1 on: December 10, 2020, 10:57:25 pm »
Is that a monolith, or are you just happy to see me?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Monolith
« Reply #2 on: December 10, 2020, 11:10:16 pm »
I don't swing that way Steve. lol

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Monolith
« Reply #3 on: December 10, 2020, 11:54:54 pm »
Here's a saucer that changes colors.

Code: QB64: [Select]
  1. _TITLE "Saucer"
  2. SCREEN _NEWIMAGE(800, 600, 32)
  3.  
  4. TYPE vec2
  5.     x AS SINGLE
  6.     y AS SINGLE
  7.  
  8. REDIM SHARED vert(8024) AS vec2, max_v_index
  9. DIM SHARED rFactor!, gFactor!, bFactor!
  10. rFactor! = .25: gFactor! = .25: bFactor! = .5
  11. _LIMIT 120
  12.     FOR t = 1 TO 360 STEP .05
  13.         _LIMIT 80
  14.         c1 = RND: c2 = RND: c3 = RND
  15.         rFactor! = c1: gFactor! = c2: bFactor! = c3
  16.         cx = (SIN(t) * 300) + 450
  17.         cy = (COS(t) * 300) / 2 + 200
  18.         max_v_index = max_v_index + .065
  19.         vert(max_v_index).x = cx
  20.         vert(max_v_index).y = cy
  21.         cx2 = (SIN(t) * 200) + 450
  22.         cy2 = (COS(t) * 200) / 2 + 200
  23.         max_v_index = max_v_index + .065
  24.         vert(max_v_index).x = cx2
  25.         vert(max_v_index).y = cy2
  26.     NEXT t
  27.  
  28.  
  29. SUB _GL ()
  30.     STATIC glInit
  31.     IF glInit = 0 THEN
  32.         glInit = 1
  33.     END IF
  34.     _glViewport -50, -50, _WIDTH, _HEIGHT
  35.     'set the gl screen so that it can work normal screen coordinates
  36.     _glTranslatef -1, 1, 0
  37.     _glScalef 1 / 400, -1 / 300, 1
  38.     _glEnable _GL_BLEND
  39.     _glBlendFunc _GL_SRC_ALPHA, _GL_ONE
  40.     _glEnableClientState _GL_VERTEX_ARRAY
  41.     _glVertexPointer 2, _GL_FLOAT, 0, _OFFSET(vert())
  42.     FOR j = 0 TO 30
  43.         _glColor4f rFactor!, gFactor!, bFactor!, 0.015
  44.         _glPointSize j
  45.         _glDrawArrays _GL_POINTS, 2, max_v_index
  46.     NEXT
  47.     _glFlush
  48.  

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Monolith
« Reply #4 on: December 11, 2020, 12:26:33 am »
Area 51?

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Monolith
« Reply #5 on: December 11, 2020, 12:31:08 am »
LOL NOVARSEG  :)

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 316
  • Needle nardle noo. - Peter Sellers
    • View Profile
Re: Monolith
« Reply #6 on: December 11, 2020, 10:49:44 am »
I gots me a monolith & Area 51 inna da Moon Lander.

Also 6 spacesheeps - LM, CM, Borg, Death Star, Starsheep Enterprise, and a Close Encounters type.

Anudder shameless plug for me code.

It works better if you plug it in.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Monolith
« Reply #7 on: December 11, 2020, 12:55:17 pm »
Awesome Richard! :)