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 / 2D sprite with a 3D position.

Author
Message
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 1st May 2010 21:34
Hello everybody!

I was just wondering what would be the best way to create a sprite in 3D as in the Doom series, I am quite confident with C++ and Dark GDK and I am able to use objects but I don't want to use them in this instance as they don't have the same appeal.

Thank you very much in advance,
from will.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st May 2010 21:49 Edited at: 1st May 2010 21:57
i think the only way is to make a plain object and texture it, so like


width is the image width
height is the image height
ID is the object ID
Image is the image ID ( dbLoadImage ( "name", Image ) )

you can use dbPositionObject ( ID, x, y, z ) to position it, you can also rotate it and scale it etc.

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 1st May 2010 21:52
Thank you very much, I will give you credit in the game
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st May 2010 21:58
no problem

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 1st May 2010 22:04
And I was just wondering, can you make it trasparent, E.G the:

dbSetImageColorKey ( 255, 0, 255 );

function to make the pink transparent, it just makes it black when textured onto the object.

Thank you so much for your help
from will.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 1st May 2010 22:09
Don't worry, I found it!

dbMakeObjectPlain (2,68,100);
dbTextureObject (2,pharaoh_trousers_body_image);
dbPositionObject(2,0,0,0);
dbSetObjectTransparency(2,1);

Thank you very much anyway
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 2nd May 2010 15:13 Edited at: 2nd May 2010 15:14
Oh well yea, didn't read the thread, you simply use dbSetObjectTransparency(ID,1) to enable alpha blending ( transparency ), then you can use alpha-channeled textures to make some parts of the object transparent, note that you can use dbSetAlphaMappingOn ( ID, alpha ) to set the whole object's alpha, im not sure if this works with the texture alpha, i think you can have only one alpha source at a time ( either texture or the alpha value )

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 2nd May 2010 16:33
ahhhh, thanks for your help...
Louis Sequin
14
Years of Service
User Offline
Joined: 10th May 2010
Location:
Posted: 10th May 2010 22:08
BTW this is the way that Dark GDK handles sprites anyway. They are handled using the direct 3d and are more or less plain objects with a texture. Not exactly, but close enough. I can't imagine you would gain much buy using textured plains over sprites and you would lose a lot in execution speed.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 22:32
so, in an RPG situation, you are telling me that I should use planes, rather the sprites as the inventory?

from helpfullprogrammer ^.^
haliop
User Banned
Posted: 10th May 2010 23:07
Louis i think you are mistaken.
once the Plain is up its easier to handle it both for the programmer and the cpu.

the math is easier again on both.
where sprite actually take more power to calculate.

with that said , its something i have heard never got to test it.

Login to post a reply

Server time is: 2024-11-19 23:37:06
Your offset time is: 2024-11-19 23:37:06