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 / Prioritising objects

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 25th Sep 2003 18:08
Is it possible to get one object to show in preference to another? Why I ask is that I am trying to make a civ3 clone and am having an annoying problem in that when a unit (represented by a cone) moves onto a tile with a city the city model always takes precedent over the cone in that some of the cone is obstructed by the city model. I would like it so that the unit (i.e. the cone object) can be seen in all its glory when it happens to occupy the same 3D position as the city model. How would I go about doing this? Does this make sense?

Thanks in advance,

Neophyte
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 25th Sep 2003 18:14
I think that the order that objects are rendered in is dependent on what number you assign the object( E.G. Make Object Cube Object Number, Size). I haven't tested this though so I could be wrong.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Sep 2003 18:20
that has something to do with the object zdepth perhaps.

try messing around with set object zdepth

http://www.lunarpixel.com
It's already tomorrow in Australia
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 25th Sep 2003 18:23
Okay, thanks guys. I'll have a play around and see if I can fix it.

Here's an early screenie of what I have so far if you're interested:

http://www.basementfactory.com/omnipotence/images/screenshots/pic_2.jpg

FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 25th Sep 2003 19:30 Edited at: 25th Sep 2003 19:31
OK, I have fiddled with the zdepth to no avail. Playing with the object number doesn't seem to help either (like it does with sprites). I'm not sure if the problem is stemming from the fact that they are both being positioned at the same point in 3D space but it doesn't seem to matter which gets drawn first as the city always obscures the cone

Here's a close up of the problem (notice that the blue is smudging from the city onto the orange cone).

http://www.tinywars.dsl.pipex.com/images/going_wrong.jpg

David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Sep 2003 19:32 Edited at: 25th Sep 2003 19:32
Quote: "set object zdepth off obj

set object zwrite off obj"


Do you have trouble with any of the above?

c:/dos
c:/dos run
run dos run
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 25th Sep 2003 19:34
Well i'm not really sure what it means . I tried altering the z pos of where I position the unit but I can't alter it too much as I need it in the centre of the tile. The pic above shows you why.

orv
22
Years of Service
User Offline
Joined: 9th Sep 2003
Location: Chicago, IL
Posted: 25th Sep 2003 20:23
how about simple hiding or fading the city model?
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 25th Sep 2003 20:34 Edited at: 25th Sep 2003 20:35
setting an objects zdepth to off means it will show over all objects
with their zdepth off, regardless of distance.
ao all u have 2 do is turn the cone off

the artist formally known as darkfluff
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 25th Sep 2003 21:10
Whats the syntax for that eek?

Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Sep 2003 23:15
DISABLE OBJECT ZDEPTH object
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Sep 2003 00:28 Edited at: 26th Sep 2003 00:29
oops sorry I always write "set object zdepth off" instead of "disable object zdepth"

I think it'd be easier to remember the other way, more consistency

If you have a complex object, just use disable object zwrite - that'd skip the entire zwriting process (no, I have no idea wha tit means either) and your prog will run faster.

c:/dos
c:/dos run
run dos run
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 26th Sep 2003 12:44
Thanks Scorpyo and David89.....that works a treat

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Sep 2003 13:37
I tell ya david 89 follows me around like a bad smell

http://www.lunarpixel.com
It's already tomorrow in Australia
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 28th Sep 2003 01:54

Login to post a reply

Server time is: 2026-07-25 07:01:45
Your offset time is: 2026-07-25 07:01:45