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 / How to mix 2d and 3d?

Author
Message
jwvanderbeck
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location:
Posted: 30th Aug 2003 16:21
Ok, forgive this really stupid problem, but its driving me crazy. I have extensive 2d and 3d programming experience in C and C++ using both Open GL and Direct X, but I wanted to mess arou d with DBPro for quickly prototyping games.

At the moment though i'm going nuts because I can't seem to mix 2D and 3D graphics in the same viewport. I know I must be doing something wrong, but I don't yet know DBPro well enough. Here is my code:



What I Want to do is display a terrain generated form a heightmap, with a 2d hud overlayed ontop of it. What IS happening is the terrain is completely covering the display and the 2d image is not shown.

- Novus Delta
- http://www.novusdelta.com
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 30th Aug 2003 16:34
The problem is, you have automatic screen updating on. DB is handling screen refreshing for you. Your 3D object is an entity you've created, so as DB refreshes the screen, it keeps refreshing the entity, but the image is only pasted once and isn't considered an entity.

To solve the problem, set yourself up a program loop and manually handle the screen refeshing yourself.



Hope that helps.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
jwvanderbeck
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location:
Posted: 30th Aug 2003 16:38
Thank you. I See what you mean now, and it stemmed from not understanding how DBPro works. My understanding was it handled ALL that for me. Guess I should have realize that some of the traditional methods would still be present

Thanks again!

- Novus Delta
- http://www.novusdelta.com
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Aug 2003 17:02
In this particular scenario, it can do everything for you. Instead of pasting the image to the display, make a sprite instead :

SPRITE 1, 0, 0, 1

Login to post a reply

Server time is: 2026-07-25 09:38:50
Your offset time is: 2026-07-25 09:38:50