Page 1 of 1
sprite3d clipping
Posted: Fri Mar 10, 2006 5:38 pm
by vanleth
Make it possible to clip 3d sprites, like you can do with the ClipSprite() command on traditional sprites.
best regards
Posted: Fri Mar 10, 2006 5:42 pm
by Joakim Christiansen
It would be quite handy indeed!
Posted: Tue May 22, 2007 7:57 pm
by DeXtr0
I can use that one too

Posted: Tue May 22, 2007 9:00 pm
by Kaeru Gaman
but it is just impossible by the way sprites are handled in DirectX.
better clip your sprites in advance and cast that into different sprites you could use as textures.
Sprite3D only can use complete sprites, it's the basic Texture-Function of DX.
Posted: Wed May 23, 2007 8:54 am
by DeXtr0
Hey Kauru,
I understand your answer 100% but for this issue below i could use Sprite 3D clipping.
Maybe you can help me locate the "code-error" I have in this code snippet of me (which is a kinda-workaround to use clipsprite):
Code: Select all
ClipSprite(BitmapText(id)\id,BitmapText(id)\CharXPos*BitmapText(id)\CharWidth,BitmapText(id)\CharYPos*BitmapText(id)\CharHeight,BitmapText(id)\CharWidth,BitmapText(id)\CharHeight)
UseBuffer(BitmapText(id)\id+99699)
DisplaySprite(BitmapText(id)\id,BitmapText(id)\XPos+(i-1)*BitmapText(id)\CharWidth,BitmapText(id)\YPos)
UseBuffer(-1)
; THIS CODE SHOULD WORK BUT SHOWS BLACK SCREEN :(
Start3D()
DisplaySprite3D(BitmapText(id)\id+99699,BitmapText(id)\XPos+(i-1)*BitmapText(id)\CharWidth,BitmapText(id)\YPos, 128)
Stop3D()
It looks logic to me but it shows a black screen.
BitmapText(id)\id+99699 refers to a 3D sprite i created before
What i'm trying to do is this:
I'm clipping the 2D sprite to show the correct character of my 2D bitmapfont.
Next I use UseBuffer to draw that on the 3D sprite
I switch back to the normal buffer and try to display the 3D sprite.
I'm definately missing something or doing something that is not "classic" or not even allowed.
Do you have any idea ?
regards,
DeXtr0
Posted: Wed May 23, 2007 11:35 am
by Kaeru Gaman
> Do you have any idea ?
first quick idea: is the dimension of your sprite3D a square with a size that's a power of two?
actually, I discovered problems with that quite a while ago..
I was trying to use a Sprite3D as Buffer to display an olkskool gamescreen with double-sized pixels..
I didn't manage to make it work then, but I only spent half an hour and threw it,
because I wanted to get a quick result and the doublesized pixels were only an additional idea...
sorry... I'm short of time at the moment... be back later...
Posted: Wed May 23, 2007 12:18 pm
by DeXtr0
Hey Kaeru,
The Sprite3D is indeed created as a square: Size 32x32:
Code: Select all
CreateSprite(BitmapText(id)\id+99699,32,32,#PB_Sprite_Texture )
Result = CreateSprite3D(BitmapText(id)\id+99699,id+99699)
I first thought this was the problem too.
I only create the 3D sprite once. I'm not required to create the 3D sprite everytime in the loop am I ?
If you need more information, let me know. I can use some help here since I'm stuck
Regards,
DeXtr0
P..S I have the same purpose as you: It will be used for some oldskool effects :roll: