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.

DarkBASIC Professional Discussion / Combining 2d and 3d graphics

Author
Message
lisac2k
13
Years of Service
User Offline
Joined: 31st Dec 2012
Location:
Posted: 31st Dec 2012 18:54
I have recently found out that the DBPro has become more accessible in the meantime (free version offered) and have been testing some of its features in the meantime, which led me to the problem described in the next paragraph.

When I try to combine 2d and 3d graphics in a certain fashion, I encounter funny results. The idea is:
- to draw some 2d graphics (sprites) first as background (first layer)
- then to draw 3d objects over it (second layer)
- then again to draw some 2d graphics (sprites) over the existing 3d and 2d (third layer)

Simple testing code:


The result is always the same: 2d has been drawn in its own layer and this is being always (depending on the "draw to front" and "draw to back" commands) behind or in front of 3d.

Using the "set sprite priority" didn't seem to help, as this seems to affect sprites only. The commands "draw sprites first/last" seems to work in the same fashion as "draw to front/back", so that didn't really help either.

Is there a possibility to combine graphic styles in the above mentioned order? Any general recommendations or ideas?
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 31st Dec 2012 21:36
use plains instead of sprites

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 31st Dec 2012 23:37
Hi lisac2k, Welcome to the forums...

What Brendy boy, A respected [ At least by me >.< ] Forum member has suggested, You would use a flat plain/plane to paste the sprite detail to, you are also able to use animated textures on these plains/planes, and use them as 3D objects, hence you can enable collision on them as well

I hope this helps

If you need more help on the topic, ask away, also if nobody posts after you, use the Edit box on the left under your username in your last post And we are always happy to help, oh and Happy New Year

lisac2k
13
Years of Service
User Offline
Joined: 31st Dec 2012
Location:
Posted: 1st Jan 2013 20:37
Thank you both for your support and kind wishes for 2013 - happy new Year as well!

I had some suspicions about plains due to mip-maping, but managed to turn it off and additionally set the transparency to be inherited from the PNG tile and applied to the plain. After setting the camera to proper distance, I've gotten perfect pixel ratio and now the textured plain looks exactly as the sprite tile from the very beginning.

Not to mention further pros in regard to lighting when using planes... All in all, great stuff; testing and prototyping continues!
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 7th Jan 2013 09:05 Edited at: 7th Jan 2013 09:05
I have another suggestion. It might in some cases be better to convert from 3D to 2D instead of the above suggestions of converting from 2D to 3D.

http://forum.thegamecreators.com/?m=forum_view&t=184514&b=1

Just offering the opposite option as it might be more useful.

Login to post a reply

Server time is: 2026-07-07 07:11:24
Your offset time is: 2026-07-07 07:11:24