Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Billboarding Sprites

Author
Message
drnelson
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 29th Mar 2005 13:54
I have an animated sprite that plays and looks quite nice. I created it with the dbCreateAnimatedSprite() function. I now wanted to put it into 3D space but can't seem to figure out exactly how to do this. I know in direct3d I'd attach it to a surface and put it in the 3D world. I am not sure how to do this in DarkSDK. I have however created a Plane and used the dbTextureObject() on it to texture my plane. However, I need the individual parts of the animation sequence, or a way to put the animated sprite on the plane. That why I can put it in 3D Space and I can have a billboard'ed explosion. (An explosion that will change orientation to it is always facing the camera)

Do I need to write my own animation code or is this doable using the DarkSDK? Or is there another way to do an sprite based animated explosion in 3D.

Thanks,
David
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Mar 2005 22:39
There isn't a simple way.

- Create a plane and position it
- Set the required texture
- Scale the texture appropriately to your individual image sizes
- Scroll the texture to the image you want to use
- Point it at the camera position
- Repeat previous two steps each frame

I haven't tried it, but it should work

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
drnelson
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 30th Mar 2005 03:29
What do you mean by:
Scroll the texture to the image you want to use?

Thanks,
David
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Mar 2005 05:08
Use dbScrollObjectTexture() - it allows you to specify the offsets for your texture

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
drnelson
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 30th Mar 2005 11:47
ok, but when I try to texture my object, it just shrinks it so the entire image shows on the object. Not the current frame of animation?

Are you saying not to use the dbCreateAnimatedSprite() function?

Thanks,
David

Login to post a reply

Server time is: 2024-11-18 23:24:28
Your offset time is: 2024-11-18 23:24:28