UseBuffer3D(#Sprite)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

UseBuffer3D(#Sprite)

Post by Dr. Dri »

It would be nice to be able to render a Sprite3D onto a simple Sprite

The Sprite only needs a DDSCAPS_3DDEVICE flag when created so i suggest a #PB_Sprite_Buffer3D flag for CreateSprite. Furthermore, it could be possible to mix it with the #PB_Sprite_Texture flag.

That would make possible to render sprite rotations, zooms and transforms onto a Sprite or a Sprite3D (a Sprite3D could even render on itself)

example:

Code: Select all

[...]

CreateSprite(#Player1, 320, 480, #PB_Sprite_Buffer3D)
CreateSprite(#Player2, 320, 480, #PB_Sprite_Buffer3D)

[...]

Repeat
  
  [...]
  
  UseBuffer3D(#Player1)
  ZoomSprite3D(#Thing1, Width1, Height1)
  DisplaySprite3D(#Thing1, x1, y1)
  
  UseBuffer3D(#Player2)
  ZoomSprite3D(#Thing2, Width2, Height2)
  DisplaySprite3D(#Thing2, x2, y2)
  
  ;Displayed onto the 640x480 screen
  DisplaySprite(#Player1, 0, 0)
  DisplaySprite(#Player2, 320, 0)
  
  UseBuffer3D(#PB_Default)
  DisplaySprite3D(#Message, xMessage, yMessage, $80)
  
  FlipBuffers()
ForEver

[...]
Dri
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

Post by thyphoon »

+1
I want an Userbuffer3d !! :)


I use sprite 3D to draw all my map !
Layer 0- the sky
Layer 1- the wall
Layer 2- Monster and hero

But when i want draw the shadow, the shadow is displayer on the wall.... and on the sky ...:(

If usebuffer3d() existe I Draw Wall,and Hero on a Sprite... and the Sprite on the Sky ... and no Shawdow on the sky !

i don't know if you understand what i Say :P
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

you can UseBuffer on the base 2D Sprite and recreate the Sprite3D to apply the changes, but only with DX7.
oh... and have a nice day.
Post Reply