Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D-ized 2D, a sort of challenge or a how to question...
#12
Here's a little proof of concept. You'll need the si3.png image I included below. I had to resize it to 960x960 and convert to 32bit color.

Play around with the x,y coordinates in the secondary x,y,z coordinates of _MAPTRIANGLE to fit the image.

Code: (Select All)
DIM si3 AS LONG '        space invaders image
DIM bg2 AS LONG '        background image
DIM by AS INTEGER '      background y
DIM GameScreen AS LONG ' software screen to update
DIM HWScreen AS LONG '   hardware screen to display

si3 = _LOADIMAGE("si3.png", 32)
bg2 = _LOADIMAGE("bg2.png", 32)
GameScreen = _NEWIMAGE(960, 960, 32)
HWScreen = _COPYIMAGE(GameScreen, 33)

SCREEN _NEWIMAGE(960, 960, 32)
DO
    _LIMIT 60
    _DEST GameScreen
    CLS
    _PUTIMAGE (0, by), bg2
    _PUTIMAGE (0, 0), si3
    _DEST 0
    _FREEIMAGE HWScreen
    HWScreen = _COPYIMAGE(GameScreen, 33)
    _MAPTRIANGLE (0, 0)-(0, 959)-(959, 959), HWScreen TO(-1, 1, -3)-(-1, -1, -1)-(1, -1, -1), 0
    _MAPTRIANGLE (0, 0)-(959, 959)-(959, 0), HWScreen TO(-1, 1, -3)-(1, -1, -1)-(1, 1, -3), 0
    _DISPLAY
    by = by - 1
    IF by = -1040 THEN by = 0
LOOP UNTIL _KEYHIT = 27
SYSTEM


Attached Files Image(s)
   
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
RE: 3D-ized 2D, a sort of challenge or a how to question... - by TerryRitchie - 04-01-2024, 03:57 PM



Users browsing this thread: 1 Guest(s)