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 / Rotating object causes it to disappear

Author
Message
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 22:42 Edited at: 25th Jul 2011 22:53
I'm using POINT OBJECT to rotate my tank turret towards a target. I can get it to point to the object, but in doing so it disappears on occasion. It rotates correctly, I can still fire shots from the tank and they travel in the right direction, the turret disappears.

Printing off continuous debug information, the POS, ANGLE, and VISIBILITY of the turret all remain constant, but the thing just doesn't render :/



I've uploaded my code and materials. The code also uses EZ Rotate for other functions. But I also included the executable you can run, the CSM file with all associated media with it as well.

Has anyone else run into this before? Its peculiar that the object rotates correctly, but sometimes just doesn't appear. It seems through casual observation that the closer the turret is to the object, the more likely it is to disappear.

NOTE: if you modify the level geometry in anyway within the CSM map, you must also rexport it as well as a .X file with IanM's exporter.

CONTROLS: Left mouse to move forward, right mouse to move back. Move mouse cursor to move camera, press "1" to fire the tank

EDIT: Rotating the object might cause it to cull incorrectly with DB, causing it to not render. Anyway to force an object to render?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 22:56
What sort of mesh is the gun barrel? [I'm assuming you mean the barrel not the turret? The turret seems to be visible in each case.]

If the cannon is a simple plain then it might not be visible from the other side. If it is a simple object then set object cull to 0 might be sufficient to fix it.
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 23:00 Edited at: 25th Jul 2011 23:02
Hey Green!
The mesh barrel is a mesh that is being imported from the CSM file. =) I'll try setting Cull to 0.

I noticed the further away I am from the mesh, the more likely it is to appear. If I'm far out - and the tank is slightly like a speck on the screen - I can see the barrel rotate around completely without any flickering.

EDIT: Didn't work :/ Also changed the near plane for the camera to .5, no dice there either
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 23:15
EDIT: Once again, IanM comes to the rescue
http://forum.thegamecreators.com/?m=forum_view&t=166733&b=1

Setting the object to frame 0 and setting it to recalculate all frames (3) causes it to render without problems.

IANM, I OWE YOU A BEER. OR TWO.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 23:22
Quote: "Once again, IanM comes to the rescue"


He often does. Glad you found the cause.

Login to post a reply

Server time is: 2026-07-11 07:05:51
Your offset time is: 2026-07-11 07:05:51