SuperSprite3D
-
- Enthusiast
- Posts: 169
- Joined: Thu Oct 05, 2006 6:44 am
- Contact:
I just ran your ground compiled example on my 7300se graphics card and it worked fine, however, when I exited the program the desktop was completely corrupted.
The whole screen was mostly black with thin horizontal lines of colour going across every now and then, the pointer was still visible and the computer was still working but it had to be restarted.
Hopefully this was just a one off glitch, I will try the examples again and let you know what happens.
The whole screen was mostly black with thin horizontal lines of colour going across every now and then, the pointer was still visible and the computer was still working but it had to be restarted.
Hopefully this was just a one off glitch, I will try the examples again and let you know what happens.

-
- Enthusiast
- Posts: 169
- Joined: Thu Oct 05, 2006 6:44 am
- Contact:
Zats bad >.< ...SuperSprite3D don't work with PB 4.01 or 4.02.
Last edited by Chrono Syndrome on Tue Mar 27, 2007 8:05 am, edited 1 time in total.
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
I use 4.02 and it works here perfectly.Cpl.Bator wrote:SuperSprite3D don't work with PB 4.01 or 4.02.

And for my use, i have modified 2 procedures for these ones which are about 2 times faster:
Code: Select all
Procedure FlipSuperSprite3D(*Sprite.SuperSprite3D,Mode.b)
StartDrawing(SpriteOutput(*Sprite\No))
Protected *DB.b=DrawingBuffer(),PF.b
Protected l.l,swf.l=DrawingBufferPitch(),rows.l=SpriteHeight(*Sprite\No)
Protected *row1.b=*DB.b,*row2.b=*DB.b+swf*(rows-1)
Select DrawingBufferPixelFormat()
Case #PB_PixelFormat_8Bits:PF=1 ; 1 bytes per pixel, palletized
Case #PB_PixelFormat_15Bits:PF=2 ; 2 bytes per pixel
Case #PB_PixelFormat_16Bits:PF=2 ; 2 bytes per pixel
Case #PB_PixelFormat_24Bits_RGB:PF=3 ; 3 bytes per pixel (RRGGBB)
Case #PB_PixelFormat_24Bits_BGR:PF=3 ; 3 bytes per pixel (BBGGRR)
Case #PB_PixelFormat_32Bits_RGB:PF=4 ; 4 bytes per pixel (RRGGBB)
Case #PB_PixelFormat_32Bits_BGR:PF=4 ; 4 bytes per pixel (BBGGRR)
EndSelect
Protected *s1.long=*DB.b,*s2.long=*DB.b+swf-PF
Select Mode
Case #Flip_Horizontally
For l=1 To rows
While *s1<*s2
Swap *s1\l,*s2\l
*s1+PF:*s2-PF
Wend
*s1=*DB.b+l*swf:*s2=*s1+swf-PF
Next
Case #Flip_Vertically
Protected *rowbuffer.b=AllocateMemory(swf)
While *row1.b<*row2.b
CopyMemory(*row1.b,*rowbuffer.b,swf):CopyMemory(*row2.b,*row1.b,swf):CopyMemory(*rowbuffer.b,*row2.b,swf); <- swap
*row1.b+swf:*row2.b-swf
Wend
FreeMemory(*rowbuffer.b)
Case #Flip_Vertically|#Flip_Horizontally
*s2+(rows-1)*swf
While *s1<*s2
Swap *s1\l,*s2\l
*s1+PF:*s2-PF
Wend
EndSelect
StopDrawing()
EndProcedure
Code: Select all
Macro CopyMatrice(Source,Target)
CopyMemory(Source#,Target#,SizeOf(MATRIX4x4))
EndMacro
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Works great on PB4.xx and Vista! 
Fred: You should include these commands in PureBasic itself.

Fred: You should include these commands in PureBasic itself.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
This is the code of infinite ground 2D
Sorry, the code is not clean
ps: use the medias of the program Infinite Ground 2D ( First post )
If you want use 3D in PureBasic, work with Dreamotion3D
@++
Sorry, the code is not clean

ps: use the medias of the program Infinite Ground 2D ( First post )
Code: Select all
IncludeFile "Include\Supersprite3D.pbi"
InitSprite() :InitSprite3D() : InitSuperSprite3D() : InitKeyboard() : InitMouse()
OpenScreen(800,600,16,"")
SetPerspective(400,300)
TransparentSpriteColor(-1,0)
UsePNGImageDecoder()
LoadSprite(0,"Ground.png",#PB_Sprite_Texture)
CreateSprite3D(0,0)
LoadSprite(1,"Mask.png",#PB_Sprite_Texture)
CreateSprite3D(1,1)
LoadSprite(2,"Arch.png",#PB_Sprite_Texture)
CreateSprite3D(2,2)
LoadSprite(3,"Wall.png",#PB_Sprite_Texture)
CreateSprite3D(3,3)
LoadSprite(4,"fond.png",#PB_Sprite_Texture)
CreateSprite3D(4,4)
LoadSprite(5,"Ceil.png",#PB_Sprite_Texture)
CreateSprite3D(5,5)
MonSprite = CreateSuperSprite3D(0,512,512)
Arch = CreateSuperSprite3D(2,512,512)
Wall = CreateSuperSprite3D(3,512,512)
Ceil = CreateSuperSprite3D(5,512,512)
Structure Ground
z.f
x.f
y.f
Alpha.l
EndStructure
Global Sol.Ground
Repeat
ClearScreen(0) : ExamineKeyboard() : ExamineMouse()
If FPST.l<ElapsedMilliseconds()
FPST=ElapsedMilliseconds()+1000
fps.l = fpsc.l
fpsc = 0
EndIf
If FPST > ElapsedMilliseconds()
fpsc+1
EndIf
Delta.l - 30
If Delta<-1024 : Delta=0 : EndIf
dx-MouseDeltaX()
If dx>768 : dx=768 : EndIf
If dx<-768 : dx=-768 : EndIf
Start3D()
Sprite3DQuality(0)
;-AFFICHAGE DU SOL
For z = 50 To 0 Step -1
For x = -2 To 2
Sol\z = Delta + z*512
RotateSuperSprite3D(MonSprite,90,0,0)
SetSuperSpritePosition(MonSprite,dx+x*512,300,Sol\z)
DisplaySuperSprite3D(MonSprite)
RotateSuperSprite3D(Ceil,-90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300-512,Sol\z)
DisplaySuperSprite3D(Ceil)
Next
Next
; son masque
DisplaySprite3D(1,0,0,128)
Sprite3DBlendingMode(5,6)
;-Affichage des arches
For z = 50 To 1 Step -1
Sol\x =15360 - x*512
Sol\z = Delta + z*512
For x = -2 To 2
RotateSuperSprite3D(Ceil,90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300+512,Sol\z)
DisplaySuperSprite3D(Ceil,100)
Next
;Reflet mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
;Reflet Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
For ax = -1 To 1
;Reflet des arches
RotateSuperSprite3D(Arch,0,0,180)
SetSuperSpritePosition(Arch,dx+(ax*512),300+256,Sol\z)
DisplaySuperSprite3D(Arch,150)
;arch
RotateSuperSprite3D(Arch,0,0,0)
SetSuperSpritePosition(Arch,dx+(ax*512),300-256,Sol\z)
DisplaySuperSprite3D(Arch)
Next
;mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300-256,Sol\z)
DisplaySuperSprite3D(Wall)
;Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-(1024),300-256,Sol\z)
DisplaySuperSprite3D(Wall)
Next
Stop3D()
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(0,0,"SuperSprite3D DEMO - Infinite Ground 2D - BGAMES TEAM",RGB(0,255,255))
DrawText(0,20,"Frame rate : "+Str(fps),RGB(0,255,255))
StopDrawing()
FlipBuffers(2)
Until KeyboardPushed(#PB_Key_Escape)

@++
I add my ICE_SpriteFont3D library to this example:
Should be faster now
Download (demo):
ground_ice.zip
Download (Userlib): ICE_SpriteFont3D
and put it to the UserLibraries folder.
Then start this example again.
Should be faster now

Download (demo):
ground_ice.zip
Download (Userlib): ICE_SpriteFont3D
and put it to the UserLibraries folder.
Then start this example again.
Code: Select all
IncludeFile "Supersprite3D.pbi"
InitSprite() :InitSprite3D() : InitSuperSprite3D() : InitKeyboard() : InitMouse()
OpenScreen(800,600,16,"")
SetPerspective(400,300)
TransparentSpriteColor(-1,0)
UsePNGImageDecoder()
LoadSprite(0,"Ground.png",#PB_Sprite_Texture)
CreateSprite3D(0,0)
LoadSprite(1,"Mask.png",#PB_Sprite_Texture)
CreateSprite3D(1,1)
LoadSprite(2,"Arch.png",#PB_Sprite_Texture)
CreateSprite3D(2,2)
LoadSprite(3,"Wall.png",#PB_Sprite_Texture)
CreateSprite3D(3,3)
LoadSprite(4,"fond.png",#PB_Sprite_Texture)
CreateSprite3D(4,4)
LoadSprite(5,"Ceil.png",#PB_Sprite_Texture)
CreateSprite3D(5,5)
LoadFont(1, "Small Font", 10)
Global SpriteFont1 = ICE_CreateSpriteFont3D($FFFF, 0, 1)
Global SpriteFont2 = ICE_CreateSpriteFont3D($FF, 0, 1)
MonSprite = CreateSuperSprite3D(0,512,512)
Arch = CreateSuperSprite3D(2,512,512)
Wall = CreateSuperSprite3D(3,512,512)
Ceil = CreateSuperSprite3D(5,512,512)
Structure Ground
z.f
x.f
y.f
Alpha.l
EndStructure
Global Sol.Ground
puls =5
Repeat
angle +1
If angle > 360: angle = 0:EndIf
heartbeat +puls
If heartbeat > 360 Or heartbeat < 0: puls*(-1):EndIf
ExamineKeyboard() : ExamineMouse()
Delta.l - 30
If Delta<-1024 : Delta=0 : EndIf
dx-MouseDeltaX()
If dx>768 : dx=768 : EndIf
If dx<-768 : dx=-768 : EndIf
Start3D()
;-AFFICHAGE DU SOL
For z = 50 To 0 Step -1
For x = -2 To 2
Sol\z = Delta + z*512
RotateSuperSprite3D(MonSprite,90,0,0)
SetSuperSpritePosition(MonSprite,dx+x*512,300,Sol\z)
DisplaySuperSprite3D(MonSprite)
RotateSuperSprite3D(Ceil,-90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300-512,Sol\z)
DisplaySuperSprite3D(Ceil)
Next
Next
; son masque
DisplaySprite3D(1,0,0,128)
Sprite3DBlendingMode(5,6)
;-Affichage des arches
Sol\x =15360 - x*512
For z = 50 To 1 Step -1
Sol\z = Delta + z*512
For x = -2 To 2
RotateSuperSprite3D(Ceil,90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300+512,Sol\z)
DisplaySuperSprite3D(Ceil,100)
Next
;Reflet mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
;Reflet Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
For ax = -1 To 1
;Reflet des arches
RotateSuperSprite3D(Arch,0,0,180)
SetSuperSpritePosition(Arch,dx+(ax*512),300+256,Sol\z)
DisplaySuperSprite3D(Arch,150)
;arch
RotateSuperSprite3D(Arch,0,0,0)
SetSuperSpritePosition(Arch,dx+(ax*512),300-256,Sol\z)
DisplaySuperSprite3D(Arch)
Next
;mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300-256,Sol\z)
DisplaySuperSprite3D(Wall)
;Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-(1024),300-256,Sol\z)
DisplaySuperSprite3D(Wall)
Next
ICE_DrawingSpriteFont3D(SpriteFont1)
ICE_DisplayRotatedFadingSpriteFont3D(400, 300,angle ,"SuperSprite3D DEMO - Infinite Ground 2D - BGAMES TEAM",255)
ICE_DrawingSpriteFont3D(SpriteFont2)
ICE_ZoomSpriteFont3D(1, heartbeat/4, heartbeat/4)
ICE_DisplayRotatedFadingSpriteFont3D(400, 200,heartbeat, "FPS: "+ Str(ICE_GetFPS()),255)
ICE_ZoomSpriteFont3D(0, heartbeat/4, heartbeat/4)
Stop3D()
FlipBuffers(0)
Until KeyboardPushed(#PB_Key_Escape)
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Re: SuperSprite3D
All of the links seem to be dead. Anyone know where to find else to find any/all of the archives in this thread?
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: SuperSprite3D
I have it.Fantoma wrote:All of the links seem to be dead. Anyone know where to find else to find any/all of the archives in this thread?
PM me if you don't find.
Re: SuperSprite3D
Does anyone know if this lib is still available? I would like to take a look at it to see if it is usable in PB4.31. All links come up as page not found. Thanks 

Re: SuperSprite3D
From all the great comments posted on this thread, I gather that Cpl.Bator's SuperSprite3D is a must see. Too bad the links are dead for me too. If it's not too much trouble Psychophanta (or anyone else who has the source), could you please post a link here, I'm sure lots of people would like to try it out. By the way how large is Supersprite3d.pbi, is it more than 800 lines? Cause if it is I can't run it
.
