Author Topic: MAPTRIANGLE in 3D  (Read 26013 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
MAPTRIANGLE in 3D
« on: June 25, 2018, 04:08:57 pm »
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(1024, 768, 32)
  2. img& = _COPYIMAGE(im&, 33)
  3. SX0 = 0: SY0 = 0: SX1 = 0: SY1 = _HEIGHT: sx2 = _WIDTH: sy2 = 0: sx3 = _WIDTH: sy3 = _HEIGHT
  4. DX0 = -2: DY0 = 2: DX1 = -2: DY1 = -2: DX2 = 2: DY2 = 2: DX3 = 2: DY3 = -2
  5.  
  6. tt = .01: t = .1
  7.     e& = ell&
  8.     Mx = _MOUSEX: My = _MOUSEY
  9.     StredX = Mx
  10.     t = t + tt: IF t > _PI(2) OR t < -_PI(2) THEN tt = tt * -1
  11.     RR = SIN(t) - 4
  12.     SS = COS(t) - 10
  13.     R = -SIN(t) * -2
  14.     s = -COS(t) * 2
  15.  
  16.     _MAPTRIANGLE (SX0, SY0)-(sx3, sy3)-(SX1, SY1), e& TO(DX0 * R, DY0 * s, RR)-(DX3 * R, DY3 * s, SS)-(DX1 * R, DY1 * s, RR), 0, _SMOOTH
  17.     _MAPTRIANGLE (SX0, SY0)-(sx3, sy3)-(sx2, sy2), e& TO(DX0 * R, DY0 * s, RR)-(DX3 * R, DY3 * s, SS)-(DX2 * R, DY2 * s, SS), 0, _SMOOTH
  18.     _DISPLAY
  19.     _FREEIMAGE e&    
  20.     _LIMIT 30
  21.  
  22.  
  23.  
  24.  
  25.     SHARED vx, vy, Mxx, Myy
  26.     LOCATE 1, 1: PRINT "This is Software Screen."
  27.     V& = _NEWIMAGE(1024, 768, 32)
  28.     _DEST V&
  29.     W = 1024: H = 768
  30.     IF Mxx = 0 THEN Mxx = 10: Myy = 10
  31.     vx = vx + Mxx: IF vx > W OR vx < 0 THEN Mxx = Mxx * -1
  32.     vy = vy + Myy: IF vy > H OR vy < 0 THEN Myy = Myy * -1
  33.     CLS , _RGB32(1, 55, 132)
  34.     LOCATE 11, 30: PRINT "This is Hardware Screen"
  35.     FOR d = 0 TO _PI / 2 STEP .2
  36.         LINE (vx - SIN(d) * 50, vy - COS(d) * 50)-(vx + SIN(d) * 50, vy + COS(d) * 50), , BF
  37.     NEXT d
  38.     _DEST 0
  39.     ell& = _COPYIMAGE(V&, 33)
  40.     _FREEIMAGE V&
  41.  
« Last Edit: November 03, 2018, 03:24:49 pm by Petr »

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #1 on: June 25, 2018, 04:14:07 pm »
Previous source code repaired, because now is this possible :-D
« Last Edit: November 03, 2018, 03:25:54 pm by Petr »

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #2 on: November 03, 2018, 03:32:50 pm »
I working on another program for a long time. It has been literally worm by my neck, so I needed to relax. So, What about, projected a normal 2D image in the form of a pyramid in 3D?

Code: QB64: [Select]
  1. image = _LOADIMAGE("dyne01.jpg", 32)
  2. imag = _NEWIMAGE(1024, 768, 32)
  3. _PUTIMAGE (_WIDTH(image), _HEIGHT(image))-(0, 0), image, imag ' downsizing image to one size
  4.  
  5. imh& = _COPYIMAGE(imag, 33) '      hardware image are need for real 3D maptriangle use
  6.     X AS SINGLE
  7.     Y AS SINGLE
  8.     Z AS SINGLE
  9.  
  10.  
  11. W = _WIDTH(imag)
  12. H = _HEIGHT(imag)
  13.  
  14. prvkuX = 60 '                       image "compression" ratio (do quads in this steps)
  15. prvkuY = 80
  16.  
  17. pX = W / prvkuX
  18. pY = H / prvkuY
  19. DIM V(4) AS V '                              SOFTWARE IMAGE ARRAY
  20.  
  21. SCREEN _NEWIMAGE(W * 2, H * 2, 32)
  22.  
  23. camX = 0
  24. camY = -300
  25. camZ = -3000
  26.  
  27.  
  28. DO UNTIL camZ > 5
  29.     camZ = camZ + 2
  30.  
  31.     FOR y = 0 TO H - 1 STEP pY
  32.         FOR x = 0 TO W - 1 STEP pX
  33.  
  34.             vyska = 115 '                   upper vertex for pyramide
  35.             dno = 100 '                     bottom vertexes for pyramide
  36.  
  37.             '                               2D Sources
  38.             V(0).X = x - (pX / 2) '         middle
  39.             V(0).Y = y - (pY / 2)
  40.  
  41.             V(1).X = x - pX '               left upper vertex '           1+--------------+2
  42.             V(1).Y = y - pY '                                              |\     d     / |
  43.             '                                                              |   \  0  /    |
  44.             V(2).X = x '                    right upper vertex  '          | a    +    c  |
  45.             V(2).Y = y - pY '                                              |   /    \     |
  46.             '                                                              |/     b    \  |
  47.             V(3).X = x '                    right bottom vertex           4+--------------+3
  48.             V(3).Y = y
  49.  
  50.             V(4).X = x - pX '               left bottom vertex
  51.             V(4).Y = y
  52.  
  53.  
  54.             'recalculating for 3D _MAPTRIANGLE use
  55.  
  56.             DIM VV(4) AS V '                 HARDWARE IMAGE ARRAY
  57.  
  58.             VV(0).X = W / 2 - V(0).X + camX '   middle vertex
  59.             VV(0).Z = H / 2 - V(0).Y + camZ
  60.             VV(0).Y = vyska + camY
  61.  
  62.  
  63.             VV(1).X = W / 2 - V(1).X + camX '   left upper vertex
  64.             VV(1).Z = H / 2 - V(1).Y + camZ
  65.             VV(1).Y = dno + camY
  66.  
  67.             VV(2).X = W / 2 - V(2).X + camX '   right upper vertex
  68.             VV(2).Z = H / 2 - V(2).Y + camZ
  69.             VV(2).Y = dno + camY
  70.  
  71.             VV(3).X = W / 2 - V(3).X + camX '   right bottom vertex
  72.             VV(3).Z = H / 2 - V(3).Y + camZ
  73.             VV(3).Y = dno + camY
  74.  
  75.             VV(4).X = W / 2 - V(4).X + camX '   left bottom vertex
  76.             VV(4).Z = H / 2 - V(4).Y + camZ
  77.             VV(4).Y = dno + camY
  78.  
  79.  
  80.             '3D with _MAPTRIANGLE is based on OpenGL, so coordinates here are 0,0,-1 in middle screen, to left is X negative, to right is X positive, for up is Y positive, for down is Y negative,
  81.             'for inward is Z negative (to -10000) and for outward is bigger to -1. If is Z higher than -1, is unvisible, is out of the screen.
  82.  
  83.  
  84.  
  85.  
  86.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(4).X, V(4).Y)-(V(0).X, V(0).Y), imh& TO(VV(1).X, VV(1).Y, VV(1).Z)-(VV(4).X, VV(4).Y, VV(4).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'a
  87.             _MAPTRIANGLE (V(4).X, V(4).Y)-(V(3).X, V(3).Y)-(V(0).X, V(0).Y), imh& TO(VV(4).X, VV(4).Y, VV(4).Z)-(VV(3).X, VV(3).Y, VV(3).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'b
  88.             _MAPTRIANGLE (V(3).X, V(3).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(VV(3).X, VV(3).Y, VV(3).Z)-(VV(2).X, VV(2).Y, VV(2).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'c
  89.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(VV(1).X, VV(1).Y, VV(1).Z)-(VV(2).X, VV(2).Y, VV(2).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'd
  90.         NEXT x
  91.     NEXT y
  92.     _DISPLAY
  93.     _LIMIT 50 'if you use higher resolution (more quads) in lines 19, 20, maybe delete or overwrite this limit.
  94.  
dyne01.jpg
* dyne01.jpg (Filesize: 57.5 KB, Dimensions: 640x426, Views: 599)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #3 on: November 03, 2018, 04:26:56 pm »
Petr, this is interesting, is there a way to tilt top end toward viewer leaving bottom edge the same?

press esc to quit:
Code: QB64: [Select]
  1. image = _LOADIMAGE("dyne01.jpg", 32)
  2. imag = _NEWIMAGE(1024, 768, 32)
  3. _PUTIMAGE (_WIDTH(image), _HEIGHT(image))-(0, 0), image, imag ' downsizing image to one size
  4.  
  5. imh& = _COPYIMAGE(imag, 33) '      hardware image are need for real 3D maptriangle use
  6.     X AS SINGLE
  7.     Y AS SINGLE
  8.     Z AS SINGLE
  9.  
  10.  
  11. W = _WIDTH(imag)
  12. H = _HEIGHT(imag)
  13.  
  14. prvkuX = 60 '                       image "compression" ratio (do quads in this steps)
  15. prvkuY = 80
  16.  
  17. pX = W / prvkuX
  18. pY = H / prvkuY
  19. DIM V(4) AS V '                              SOFTWARE IMAGE ARRAY
  20.  
  21. SCREEN _NEWIMAGE(W * 2, H * 2, 32)
  22.  
  23. camX = -180
  24. camY = -200
  25. camZ = -500
  26.  
  27. dir = 1
  28. DO UNTIL _KEYDOWN(27) <> 0
  29.     camZ = camZ + 2 * dir
  30.     IF camZ > -400 THEN dir = -dir: camZ = -400: camX = camX - 4
  31.     IF camZ < -500 THEN dir = -dir: camZ = -500: camY = camY - 4
  32.  
  33.  
  34.     FOR y = 0 TO H - 1 STEP pY
  35.         FOR x = 0 TO W - 1 STEP pX
  36.  
  37.             vyska = 118 '                   upper vertex for pyramide  115
  38.             dno = 110 '                     bottom vertexes for pyramide 100
  39.  
  40.             '                               2D Sources
  41.             V(0).X = x - (pX / 2) '         middle
  42.             V(0).Y = y - (pY / 2)
  43.  
  44.             V(1).X = x - pX '               left upper vertex '           1+--------------+2
  45.             V(1).Y = y - pY '                                              |\     d     / |
  46.             '                                                              |   \  0  /    |
  47.             V(2).X = x '                    right upper vertex  '          | a    +    c  |
  48.             V(2).Y = y - pY '                                              |   /    \     |
  49.             '                                                              |/     b    \  |
  50.             V(3).X = x '                    right bottom vertex           4+--------------+3
  51.             V(3).Y = y
  52.  
  53.             V(4).X = x - pX '               left bottom vertex
  54.             V(4).Y = y
  55.  
  56.  
  57.             'recalculating for 3D _MAPTRIANGLE use
  58.  
  59.             DIM VV(4) AS V '                 HARDWARE IMAGE ARRAY
  60.  
  61.             VV(0).X = W / 2 - V(0).X + camX '   middle vertex
  62.             VV(0).Z = H / 2 - V(0).Y + camZ
  63.             VV(0).Y = vyska + camY
  64.  
  65.  
  66.             VV(1).X = W / 2 - V(1).X + camX '   left upper vertex
  67.             VV(1).Z = H / 2 - V(1).Y + camZ
  68.             VV(1).Y = dno + camY
  69.  
  70.             VV(2).X = W / 2 - V(2).X + camX '   right upper vertex
  71.             VV(2).Z = H / 2 - V(2).Y + camZ
  72.             VV(2).Y = dno + camY
  73.  
  74.             VV(3).X = W / 2 - V(3).X + camX '   right bottom vertex
  75.             VV(3).Z = H / 2 - V(3).Y + camZ
  76.             VV(3).Y = dno + camY
  77.  
  78.             VV(4).X = W / 2 - V(4).X + camX '   left bottom vertex
  79.             VV(4).Z = H / 2 - V(4).Y + camZ
  80.             VV(4).Y = dno + camY
  81.  
  82.  
  83.             '3D with _MAPTRIANGLE is based on OpenGL, so coordinates here are 0,0,-1 in middle screen, to left is X negative, to right is X positive, for up is Y positive, for down is Y negative,
  84.             'for inward is Z negative (to -10000) and for outward is bigger to -1. If is Z higher than -1, is unvisible, is out of the screen.
  85.  
  86.  
  87.  
  88.  
  89.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(4).X, V(4).Y)-(V(0).X, V(0).Y), imh& TO(VV(1).X, VV(1).Y, VV(1).Z)-(VV(4).X, VV(4).Y, VV(4).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'a
  90.             _MAPTRIANGLE (V(4).X, V(4).Y)-(V(3).X, V(3).Y)-(V(0).X, V(0).Y), imh& TO(VV(4).X, VV(4).Y, VV(4).Z)-(VV(3).X, VV(3).Y, VV(3).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'b
  91.             _MAPTRIANGLE (V(3).X, V(3).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(VV(3).X, VV(3).Y, VV(3).Z)-(VV(2).X, VV(2).Y, VV(2).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'c
  92.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(VV(1).X, VV(1).Y, VV(1).Z)-(VV(2).X, VV(2).Y, VV(2).Z)-(VV(0).X, VV(0).Y, VV(0).Z) 'd
  93.         NEXT x
  94.     NEXT y
  95.     _DISPLAY
  96.     _LIMIT 50 'if you use higher resolution (more quads) in lines 19, 20, maybe delete or overwrite this limit.
  97.  
  98.  

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #4 on: November 03, 2018, 07:06:48 pm »
Hi Bplus. Thank for your interest. Is it so enough?

Code: QB64: [Select]
  1. image = _LOADIMAGE("dyne01.jpg", 32)
  2. imag = _NEWIMAGE(1024, 768, 32)
  3. _PUTIMAGE (_WIDTH(image), _HEIGHT(image))-(0, 0), image, imag ' downsizing image to one size
  4.  
  5. imh& = _COPYIMAGE(imag, 33) '      hardware image are need for real 3D maptriangle use
  6.     X AS SINGLE
  7.     Y AS SINGLE
  8.     Z AS SINGLE
  9.  
  10.  
  11. W = _WIDTH(imag)
  12. H = _HEIGHT(imag)
  13.  
  14. prvkuX = 150 '                       image "compression" ratio (do quads in this steps)
  15. prvkuY = 150
  16.  
  17. pX = W / prvkuX
  18. pY = H / prvkuY
  19. DIM V(4) AS V '                              SOFTWARE IMAGE ARRAY
  20. DIM px(4), O(4) AS V
  21.  
  22. SCREEN _NEWIMAGE(W * 2, H * 2, 32)
  23.  
  24. camX = -200
  25. camY = -100
  26. camZ = -800
  27.  
  28.  
  29.  
  30.     FOR y = 0 TO H - 1 STEP pY
  31.         FOR x = 0 TO W - 1 STEP pX
  32.  
  33.             vyska = 125 '                   upper vertex for pyramide
  34.             dno = 100 '                     bottom vertexes for pyramide
  35.  
  36.             '                               2D Sources
  37.             V(0).X = x - (pX / 2) '         middle
  38.             V(0).Y = y - (pY / 2)
  39.  
  40.             V(1).X = x - pX '               left upper vertex '           1+--------------+2
  41.             V(1).Y = y - pY '                                              |\     d     / |
  42.             '                                                              |   \  0  /    |
  43.             V(2).X = x '                    right upper vertex  '          | a    +    c  |
  44.             V(2).Y = y - pY '                                              |   /    \     |
  45.             '                                                              |/     b    \  |
  46.             V(3).X = x '                    right bottom vertex           4+--------------+3
  47.             V(3).Y = y
  48.  
  49.             V(4).X = x - pX '               left bottom vertex
  50.             V(4).Y = y
  51.  
  52.  
  53.             'recalculating for 3D _MAPTRIANGLE use
  54.  
  55.             DIM VV(4) AS V '                 HARDWARE IMAGE ARRAY
  56.  
  57.             VV(0).X = W / 2 - V(0).X + camX '   middle vertex
  58.             VV(0).Z = H / 2 - V(0).Y + camZ
  59.             VV(0).Y = vyska + camY
  60.  
  61.  
  62.             VV(1).X = W / 2 - V(1).X + camX '   left upper vertex
  63.             VV(1).Z = H / 2 - V(1).Y + camZ
  64.             VV(1).Y = dno + camY + 10
  65.  
  66.             VV(2).X = W / 2 - V(2).X + camX '   right upper vertex
  67.             VV(2).Z = H / 2 - V(2).Y + camZ
  68.             VV(2).Y = dno + camY + 10
  69.  
  70.             VV(3).X = W / 2 - V(3).X + camX '   right bottom vertex
  71.             VV(3).Z = H / 2 - V(3).Y + camZ
  72.             VV(3).Y = dno + camY
  73.  
  74.             VV(4).X = W / 2 - V(4).X + camX '   left bottom vertex
  75.             VV(4).Z = H / 2 - V(4).Y + camZ
  76.             VV(4).Y = dno + camY
  77.  
  78.  
  79.             '3D with _MAPTRIANGLE is based on OpenGL, so coordinates here are 0,0,-1 in middle screen, to left is X negative, to right is X positive, for up is Y positive, for down is Y negative,
  80.             'for inward is Z negative (to -10000) and for outward is bigger to -1. If is Z higher than -1, is unvisible, is out of the screen.
  81.  
  82.             rotation = rotation + .0001
  83.  
  84.             sinr! = SIN(-rotation / 57.2957795131): cosr! = COS(-rotation / 57.2957795131)
  85.             FOR i& = 0 TO 4
  86.                 x2& = ((VV(i&).X * cosr!) + (sinr! * VV(i&).Z)) + VV(i&).X
  87.                 y2& = ((VV(i&).Z * cosr!) - (VV(i&).X * sinr!)) + VV(i&).Z
  88.  
  89.                 O(i&).X = x2& + VV(i&).X
  90.                 O(i&).Z = VV(i&).Z + y2&
  91.                 O(i&).Y = VV(i&).Y - 200
  92.             NEXT
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(4).X, V(4).Y)-(V(0).X, V(0).Y), imh& TO(O(1).X, O(1).Y, O(1).Z)-(O(4).X, O(4).Y, O(4).Z)-(O(0).X, O(0).Y, O(0).Z), _SMOOTH 'a
  101.             _MAPTRIANGLE (V(4).X, V(4).Y)-(V(3).X, V(3).Y)-(V(0).X, V(0).Y), imh& TO(O(4).X, O(4).Y, O(4).Z)-(O(3).X, O(3).Y, O(3).Z)-(O(0).X, O(0).Y, O(0).Z), _SMOOTH 'b
  102.             _MAPTRIANGLE (V(3).X, V(3).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(O(3).X, O(3).Y, O(3).Z)-(O(2).X, O(2).Y, O(2).Z)-(O(0).X, O(0).Y, O(0).Z), _SMOOTH 'c
  103.             _MAPTRIANGLE (V(1).X, V(1).Y)-(V(2).X, V(2).Y)-(V(0).X, V(0).Y), imh& TO(O(1).X, O(1).Y, O(1).Z)-(O(2).X, O(2).Y, O(2).Z)-(O(0).X, O(0).Y, O(0).Z), _SMOOTH 'd
  104.         NEXT x
  105.     NEXT y
  106.     _DISPLAY
  107.     _LIMIT 20 'if you use higher resolution (more quads) in lines 19, 20, maybe delete or overwrite this limit.
  108.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #5 on: November 03, 2018, 08:53:37 pm »
It is moving fastest when it is largest and best chance to see details is lost.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #6 on: November 04, 2018, 03:21:04 am »
Yeah. With close proximity, the GPU has fewer computations and increases speed. Well, I will write something similar and try it better :-D

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #7 on: November 04, 2018, 08:55:18 am »
It is a good Halloween animation!
:-)
Programming isn't difficult, only it's  consuming time and coffee

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #8 on: November 05, 2018, 01:12:21 am »
Hi Petr!
Nice work on this!
For speed, you can try doing this in OpenGL (using array buffers).
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 Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #9 on: November 05, 2018, 03:19:29 pm »
Hi Ashish. I like to see you here after a long time! Yes, with OpenGL the solution is here. I'm sure I'll go back to him, but I'll still be doing some attempts with _MAPTRIANGLE. I assume that QB64 problems with OpenGL will worsen over time (because OpenGL is no longer supported by some OS, instead of Vulkan) so we maybe may see Vulcan in QB64 :-D. Yeah, it's more like a dream.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: MAPTRIANGLE in 3D
« Reply #10 on: November 05, 2018, 03:53:06 pm »
Molten might be the way for us to go in the future:  https://moltengl.com

Quote
Molten GL provides the power to transform your graphics applications and games on iOS and macOS platforms. This premier product from the developers of MoltenVK will run your OpenGL ES 2.0 application or game on iOS or macOS using Metal — and faster!

No need to rewrite rendering logic and shaders for different platforms or abandon the familiar OpenGL ES 2.0 API. Applications built for OpenGL ES 2.0 can use MoltenGL to run on top of Metal, to gain the additional graphic performance of Metal today, and to protect your investments in OpenGL ES into the future!
« Last Edit: November 08, 2018, 08:33:10 am by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #11 on: November 08, 2018, 08:21:02 am »
Hi Ashish. I like to see you here after a long time! Yes, with OpenGL the solution is here. I'm sure I'll go back to him, but I'll still be doing some attempts with _MAPTRIANGLE. I assume that QB64 problems with OpenGL will worsen over time (because OpenGL is no longer supported by some OS, instead of Vulkan) so we maybe may see Vulcan in QB64 :-D. Yeah, it's more like a dream.
If OpenGL is going to be loose its support from some OS then, _MAPTRIANGLE will also not work, since _MAPTRIANGLE itself uses some GL commands internally.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


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

FellippeHeitor

  • Guest
Re: MAPTRIANGLE in 3D
« Reply #12 on: November 08, 2018, 08:24:58 am »
We're not removing OpenGL support. Also, everything indicates we'll be back as normal in macOS in the upcoming 10.14.2 version of their OS.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #13 on: November 08, 2018, 09:47:58 am »
We're not removing OpenGL support. Also, everything indicates we'll be back as normal in macOS in the upcoming 10.14.2 version of their OS.
Thank God! :)
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 Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: MAPTRIANGLE in 3D
« Reply #14 on: November 08, 2018, 12:55:33 pm »
I  also like restoring QB64 functionality to all supported systems. I will add to this thread the transcript of these OpenGL samples in the future. (so if we take Galleon's pattern, it will never be :-D) The display principle is the same (the OpenGL and 3D MAPTRIANGLE coordinate system), of course for 3D MAPTRIANGLE it is necessary to add a lot of already completed functions that OpenGL internally supports, such as a color transition from top to top, or _glrotatef (through modified ROTOZOOM), and I'm not talking about lighting. Again, using _MAPTRIANGLE, it is easier to perform texture than opens in OpenGL, where I have not yet come up with the reason why freeing texture work not right (with gl statement) and where I am very sorry for the miserable internal GLUT support. The tea pot, she sent me to the ground. The reason for her removal is..... and cause UNCOMPATIBILTY....  no, better no comment.

Problem with the buffer and speed, pointed out by BPlus, I assume that the _DEPTHBUFFER command should resolve this issue.

I do not want to hurt anyone here who is trying to support the flourishing QB64. I'm glad for it. Teapot is the only thing I do not take as a step forward. Well, gentlemen, I'm going to go into the depths of the code, I did not have time. I had to change the gutter on the roof. He was already very rusted Yeah. I sometimes do this too.
« Last Edit: November 08, 2018, 12:56:41 pm by Petr »