Page 2 of 3

Posted: Fri Oct 27, 2006 4:27 pm
by Dare
Blooming impressive!

Posted: Sat Jan 13, 2007 2:17 pm
by Chrono Syndrome
Any progress :( ?

Posted: Sat Jan 13, 2007 2:44 pm
by Derek
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. :?

Posted: Sat Jan 13, 2007 3:00 pm
by Derek
Just ran infinite ground, not working. :cry:

Edit: Found out what it was, opening a 1024 * 768 screen with my crappy graphics board corrupts the screen after the program ends. :cry: :cry:

Posted: Sun Jan 21, 2007 4:50 pm
by Anonymous
I have'nt internet connection in my home. SuperSprite3D don't work with PB 4.01 or 4.02.

Sry.

@+

Posted: Mon Jan 22, 2007 10:36 am
by Chrono Syndrome
SuperSprite3D don't work with PB 4.01 or 4.02.
Zats bad >.< ...

Posted: Fri Mar 16, 2007 9:50 pm
by Psychophanta
Cpl.Bator wrote:SuperSprite3D don't work with PB 4.01 or 4.02.
I use 4.02 and it works here perfectly. :D
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
And

Code: Select all

Macro CopyMatrice(Source,Target)
  CopyMemory(Source#,Target#,SizeOf(MATRIX4x4))
EndMacro

Posted: Sun Mar 25, 2007 5:39 am
by Rook Zimbabwe
This does look fantastic! My version has no real examples... I would love to see what you have done with infinite ground etc. Any way to post some examples? Code for examples? anything??? :D

Posted: Sun Mar 25, 2007 2:15 pm
by DoubleDutch
Works great on PB4.xx and Vista! :D

Fred: You should include these commands in PureBasic itself.

Posted: Sun Mar 25, 2007 10:32 pm
by Anonymous
This is the code of infinite ground 2D
Sorry, the code is not clean :wink:


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)

If you want use 3D in PureBasic, work with Dreamotion3D :wink:

@++

Posted: Tue Mar 27, 2007 7:24 am
by IceSoft
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.

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) 

Re: SuperSprite3D

Posted: Thu Sep 24, 2009 1:19 pm
by Fantoma
All of the links seem to be dead. Anyone know where to find else to find any/all of the archives in this thread?

Re: SuperSprite3D

Posted: Thu Sep 24, 2009 8:39 pm
by Psychophanta
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?
I have it.
PM me if you don't find.

Re: SuperSprite3D

Posted: Thu Sep 24, 2009 10:33 pm
by Tazman47
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 :D

Re: SuperSprite3D

Posted: Fri Sep 25, 2009 8:05 pm
by Teng
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 :( .