Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_MAPTRIANGLE EXAMPLES
#11
PLEASE MAP IT TO SPHERE now! 

+1 for that though! Awesome!

John
Reply
#12
Very cool, @ahenry3068! And thanks, @Petr!
Reply
#13
(01-23-2026, 10:05 PM)Unseen Machine Wrote: PLEASE MAP IT TO SPHERE now! 

+1 for that though! Awesome!

John


   If you'll point me at some code for mapping an image to a sphere then probably can accomplish that.   But I'm while I'm pretty familiar with Computer Imaging I'm very much an
amateur at this 3-D stuff.   I need to look at some example code !
Reply
#14
(01-24-2026, 12:04 AM)ahenry3068 Wrote:
(01-23-2026, 10:05 PM)Unseen Machine Wrote: PLEASE MAP IT TO SPHERE now! 

+1 for that though! Awesome!

John


   If you'll point me at some code for mapping an image to a sphere then probably can accomplish that.   But I'm while I'm pretty familiar with Computer Imaging I'm very much an
amateur at this 3-D stuff.   I need to look at some example code !

Image to Sphere is here:
https://qb64phoenix.com/forum/showthread...47#pid2647

On page 3 reply #28 of same thread Terry Ritchie starts discussion and offers his own mods to image to sphere. It was discussed for several pages as Terry worked his own mod of it so you might learn from that also. I believe my code is simpler but might be slower too?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#15
(01-24-2026, 12:57 AM)bplus Wrote:
(01-24-2026, 12:04 AM)ahenry3068 Wrote:
(01-23-2026, 10:05 PM)Unseen Machine Wrote: PLEASE MAP IT TO SPHERE now! 

+1 for that though! Awesome!

John


   If you'll point me at some code for mapping an image to a sphere then probably can accomplish that.   But I'm while I'm pretty familiar with Computer Imaging I'm very much an
amateur at this 3-D stuff.   I need to look at some example code !

Image to Sphere is here:
https://qb64phoenix.com/forum/showthread...47#pid2647

On page 3 reply #28 of same thread Terry Ritchie starts discussion and offers his own mods to image to sphere. It was discussed for several pages as Terry worked his own mod of it so you might learn from that also. I believe my code is simpler but might be slower too?

 Well I made a stab unsuccessfully so far.   But I'll keep at it.   Should be doable.   Past my bedtime now and I work the next couple days !
Reply
#16
(01-24-2026, 12:04 AM)ahenry3068 Wrote:
(01-23-2026, 10:05 PM)Unseen Machine Wrote: PLEASE MAP IT TO SPHERE now! 

+1 for that though! Awesome!

John


   If you'll point me at some code for mapping an image to a sphere then probably can accomplish that.   But I'm while I'm pretty familiar with Computer Imaging I'm very much an
amateur at this 3-D stuff.   I need to look at some example code !

@ahenry3068 here is some image to sphere code HOT! off the press for you to study Smile


Attached Files
.zip   Sphere On Fire.zip (Size: 34.49 KB / Downloads: 9)
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#17
AND THATS WHY WE LOVE YA @bplus ! +1 just for the willingness!

Me
Reply
#18
Thanks I think I matched the fire colors in your avatar better in my Mod found in Proggies Smile
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#19
OK @NakedApe perfect demo of _MapTriangle for YOU!
   

Code: (Select All)
_Title "Ape Qubed" ' b+ 2026-01-24
Type xy
    As Single x, y
End Type

Screen _NewImage(700, 700, 32)
_ScreenMove 300, 0

Dim sb As Long
sb = _LoadImage("ape.PNG")

' draw cube 3 faces showing
Dim c(0 To 6) As xy
c(0).x = 350: c(0).y = 350
For i = 1 To 6
    c(i).x = 350 + 340 * Cos(i * _Pi / 3)
    c(i).y = 350 + 340 * Sin(i * _Pi / 3)
Next

'top face
_MapTriangle _Seamless(0, 0)-(_Width(sb) - 1, 0)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(4).x, c(4).y)-(c(5).x, c(5).y)-(c(6).x, c(6).y), 0
_MapTriangle _Seamless(0, 0)-(0, _Height(sb) - 1)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(4).x, c(4).y)-(c(0).x, c(0).y)-(c(6).x, c(6).y), 0

'right face
_MapTriangle _Seamless(0, 0)-(_Width(sb) - 1, 0)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(0).x, c(0).y)-(c(6).x, c(6).y)-(c(1).x, c(1).y), 0
_MapTriangle _Seamless(0, 0)-(0, _Height(sb) - 1)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(0).x, c(0).y)-(c(2).x, c(2).y)-(c(1).x, c(1).y), 0
ftri c(0).x, c(0).y, c(6).x, c(6).y, c(1).x, c(1).y, &H99000000
ftri c(1).x, c(1).y, c(2).x, c(2).y, c(0).x, c(0).y, &H99000000


' front face
_MapTriangle _Seamless(0, 0)-(_Width(sb) - 1, 0)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(3).x, c(3).y)-(c(4).x, c(4).y)-(c(0).x, c(0).y), 0
_MapTriangle _Seamless(0, 0)-(0, _Height(sb) - 1)-(_Width(sb) - 1, _Height(sb) - 1), sb To(c(3).x, c(3).y)-(c(2).x, c(2).y)-(c(0).x, c(0).y), 0
ftri c(4).x, c(4).y, c(0).x, c(0).y, c(2).x, c(2).y, &H55000000
ftri c(2).x, c(2).y, c(3).x, c(3).y, c(4).x, c(4).y, &H55000000
Sleep

Sub ftri (x1, y1, x2, y2, x3, y3, K As _Unsigned Long)
    Dim D As Long
    Static a&
    D = _Dest
    If a& = 0 Then a& = _NewImage(1, 1, 32)
    _Dest a&
    _DontBlend a& '  '<<<< new 2019-12-16 fix
    PSet (0, 0), K
    _Blend a& '<<<< new 2019-12-16 fix
    _Dest D
    _MapTriangle _Seamless(0, 0)-(0, 0)-(0, 0), a& To(x1, y1)-(x2, y2)-(x3, y3)
End Sub

You can Cube any image with this code, see my new Avatar!

Zip with source and image:


Attached Files
.zip   Ape Cube.zip (Size: 175.43 KB / Downloads: 10)
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#20
LOL! I love it, @bplus! That's my aunt Koko. I'll check out the prog. Thanks vm!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  A Question About _MAPTRIANGLE Magdha 2 377 11-02-2025, 11:37 AM
Last Post: Magdha
  Using _MapTriangle in Small Virtual Screens NakedApe 7 830 07-05-2025, 11:54 AM
Last Post: SMcNeill
  Does _MapTriangle work in a user defined Window? bplus 12 2,227 02-16-2024, 01:40 AM
Last Post: bplus
  _MAPTRIANGLE face culling RokCoder 0 449 01-10-2023, 07:29 PM
Last Post: RokCoder
Music does anyone have any examples of a simple MIDI recorder or digital audio overdubber? madscijr 9 1,997 07-29-2022, 05:13 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)