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 Discussion / Zdepth bug for Lock object on command?

Author
Message
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 19th Apr 2009 14:34
There appears to be some sort of internal zdepth object violation when using the lock object on command. What I mean is this. Locking the attached gun onto the screen and rotating it (with left/right cursors) results some parts of the front of the gun being rendered before the back so you get a sort of X-ray effect. Now if you press 1 to "lock object off" the X-ray problem disappears. Does anyone know of any fix or work around, without actually locking the object off? (its a long story why I need the object locked on)

Thanks.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Apr 2009 01:01
Quote: "Does anyone know of any fix or work around, without actually locking the object off? (its a long story why I need the object locked on)"

I think when using the lock on, the object zdepth is automatically disabled and there's nothing you can do about it so locked objects always appear over all other objects. I also think (though I don't really know) that a locked object is placed on or behind the front camera clipping plane so any parts of the object in front of this plane are drawn, and any parts of the object behind the plane are not - that's just a guess.

Anyway, the only way I can think of avoiding this is position the object yourself without lock on. There's many ways to do this. Check out this link. It's a way using math to do it all wrapped up in a function:

Lock camera

To use the function, take the
set object rotation xyz
out of the function at the bottom. This call is not necessary; but the set object rotation zyx at the top of the function is necessary.

Enjoy your day.
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 20th Apr 2009 01:33
Brilliant! Thanks Latch.

Login to post a reply

Server time is: 2025-06-08 05:45:32
Your offset time is: 2025-06-08 05:45:32