Page 1 of 1

UseBuffer3D(#Sprite)

Posted: Tue Sep 26, 2006 12:13 pm
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

Posted: Mon Jul 20, 2009 6:44 pm
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

Posted: Tue Jul 21, 2009 12:52 am
by Kaeru Gaman
you can UseBuffer on the base 2D Sprite and recreate the Sprite3D to apply the changes, but only with DX7.