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 / Need help with Object, Sprite and Image Layering.

Author
Message
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Mar 2011 05:38
I am working on a simple 3D shooter. I have simulated a 3D starfield using the 2D dot command. And I have a couple HUD’s. The problem is I cannot seem to get the 3D object drawn in front of the starfield while having it drawn behind the HUD’s. I have tried DRAW TO FRONT, DRAW SPRITE LAST and every combination there of. I have tried making the HUD’s an image or a sprite. I have tried with backdrop on and off. With backdrop off I had to use CREATE BITMAP and draw the starfield to it then copy to the screen. I have tried every combination of these things and the opposite with no luck. If there is some way, any way to pull this off, I would be grateful for your help.

Main Source:


Initialization:


Functions:


Thank you.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 9th Mar 2011 06:57
I tried to run your code, but I couldn't get it to run?

Briefly, I've been playing around with Zdepth, Zwrite & zread to get a plane that is physically located behind an object to render as if it were infront. Perhaps these commands will help with what you're trying to achieve?

Help build an online DarkBASIC Professional help archive.
[href= http://dbprohelp.wikia.com/wiki/DarkBASIC_Professional_Help_Wiki]DarkBasic Help Wikia[/href]
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Mar 2011 19:45
Thank you, Burning Feet Man.

Actually I delved into using those commands already, but I tried again anyway. I still can’t seem to find a working combination. I think maybe if I render the starfield onto a plane? Or maybe I should just abandon that starfield technique and try particles or 3D objects for that, I don’t know. Attached is the code and media. If anyone can see something in this code that can be done differently or has an idea how to make it work. I would appreciate your feedback.

Thanks.

WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Mar 2011 05:24
Solved, the particle system seems the way to go.

Login to post a reply

Server time is: 2026-07-15 03:39:07
Your offset time is: 2026-07-15 03:39:07