I have read the docs and tried to get a flipped version of the original sprite... sadly without success... Maybe someone of you can help me how to flip a Sprite3D:
Original looks like:
AAAA
BBBB
CCCC
DDDD
The transformed (flipped) version should look like:
DDDD
CCCC
BBBB
AAAA
Many thanks in advance!
TransformSprite3D() - How to flip a Sprite3D ?
TransformSprite3D() - How to flip a Sprite3D ?
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
mhhhh.... that are sadly bad news... still wonder, why there is/are no flip sprite2d/3d commands available...
Is there really no way to flip a sprite using TransformSprite3D() without using extra own function code?
Is there really no way to flip a sprite using TransformSprite3D() without using extra own function code?
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
I just tried to flip it, and it showed nothing until I kept an eye on the normal of the texture.
when rotating it 180°, it showed properly.
this leaded me to the conclusion, that Sprie3D is a standard quad wich has a normal and an invisible backside.
according to this there would be no way to flip a Sprite3D, since this would always show the backside.
maybe there are textures in 3D that can be flipped, but not this type.
funny enough, I can't remember I ever needed a function to flip a sprite upside down, thus i didn't miss it yet.
would it be acceptable for you to prerender the flipped image?
flip the 2D sprite on startup into a second sprite and use both for seperated sprite3D.
when rotating it 180°, it showed properly.
this leaded me to the conclusion, that Sprie3D is a standard quad wich has a normal and an invisible backside.
according to this there would be no way to flip a Sprite3D, since this would always show the backside.
maybe there are textures in 3D that can be flipped, but not this type.
funny enough, I can't remember I ever needed a function to flip a sprite upside down, thus i didn't miss it yet.
would it be acceptable for you to prerender the flipped image?
flip the 2D sprite on startup into a second sprite and use both for seperated sprite3D.
oh... and have a nice day.
yes i ithink u are right about the normal quad and its invisible backside. However afaik their are ways that even the backside is visible but afaik this may shut down the rendering performance a bit.
I know about the prerendering... but a) for my actually tiny project this is not acceptable and b) why prerendering when it coule be done using DX and accelated? ^^
I am sure i can tell you examples where it would be nice to flip spites... just think about a walking animation tileset of a guy, walking to the left direction... you can simple flip the sprite and have the guy walking to the right too (with just only one original sprite, we just have to mirror/flip ^^)
I know about the prerendering... but a) for my actually tiny project this is not acceptable and b) why prerendering when it coule be done using DX and accelated? ^^
I am sure i can tell you examples where it would be nice to flip spites... just think about a walking animation tileset of a guy, walking to the left direction... you can simple flip the sprite and have the guy walking to the right too (with just only one original sprite, we just have to mirror/flip ^^)
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
With DirectX7 subsystem you can disable backface culling with the following:
For DirectX9 subsystem use:
This doesn't need to be in your main loop, you only need to do it once after OpenScreen().
Code: Select all
Global D3Ddevice_interface7.IDirect3DDevice7
Start3D()
!extrn _PB_Direct3D_Device
!MOV dword EAX, [_PB_Direct3D_Device]
!MOV dword [v_D3Ddevice_interface7],EAX
D3Ddevice_interface7\SetRenderState(22,1) ;(D3DRENDERSTATE_CULLMODE,D3DCULL_NONE)
Stop3D()
Code: Select all
Global D3Ddevice_interface9.IDirect3DDevice9
Start3D()
!extrn _PB_Screen_Direct3DDevice
!MOV dword EAX, [_PB_Screen_Direct3DDevice]
!MOV dword [v_D3Ddevice_interface9],EAX
D3Ddevice_interface9\SetRenderState(22,1)
Stop3D()
Re: TransformSprite3D() - How to flip a Sprite3D ?
do you know how to disable backface culling with PB 5.20 ?
Thanks
Thanks
-
- Enthusiast
- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
Re: TransformSprite3D() - How to flip a Sprite3D ?
is there no way to flip the uv coordinates instead of the entire quad?


Re: TransformSprite3D() - How to flip a Sprite3D ?
Use OGL gadget or Screen 3D render which allows you to diskort/skew/rotate/flip/scale and scroll texture.