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 / Locking messes up my objects

Author
Message
Jerry
20
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 10th Jan 2005 15:44
[IMG]http://img126.exs.cx/img126/900/messedupglock2jm.jpg
[img=http://img126.exs.cx/img126/900/messedupglock2jm.jpg]

I KNOW someone has posted this before concerning an AK47 model. However, the responses did not provided a solution past "do some custom coding". Well, I'm new to Dark Basic, and I'm not the greatest with math and stuff either, so can anyone provide a solution?
In case readers still don't know what the problem is: When I lock my model (which, by the way is a .x file) to the camera, bits and pieces that are actually INSIDE the model seem to get rendered on top of the other faces that should have been there instead. Its a bad description, but look at the pictures.
My code so far (although I doubt anything is wrong with it) is pretty short since I encountered this problem early on.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 11th Jan 2005 00:56 Edited at: 11th Jan 2005 00:57
the code is not displaying in the source box. Try useing the code button.


The happenings of tommorow are behind us now
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jan 2005 01:21
I've had that problem with DBClassic - there are a couple of things you should try...

DISABLE OBJECT ZDEPTH Obj
- Which would mean it's drawn over the top of everything.

SET OBJECT CULLING Obj,0
- Would force it to draw both sides and might stop the wrong sides of polygons being drawn.

The other option is to forget locking it to the screen and positioning it instead - this is best done with a modified model that is offset - you might be able to get it on the screen nicely by offsetting the main limb though:

POSITION OBJECT Obj,Camera position x(),Camera position y(),Camera position z()
ROTATE OBJECT Obj,Camera angle x(),Camera angle y(),0

This will keep the object with the camera, only it won't be static if you use an offset model, it'll actually look better because the gun will move more realistically when your aiming. Also - when you glue an object, you can't do very much with it, by keeping it seperate, you can glue other objects onto it, guage the position of limbs etc - I have 2 limbs on my weapons to signify where to glue a flare, and another to signify the start of a bullet. With 2 locations in 3D, calculating your bullets directions is very easy.


Van-B


It's c**p being the only coder in the village.
Jerry
20
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 11th Jan 2005 01:47
The ZDepth command didn't fix the problem and the SET OBJECT CULLING just didn't work at all (didn't compile). I'll try looking in the commands section to see just what's wrong; maybe u made a mistake while typing?

Anyways, aside from the see-through problems I'm also having a slight problem with animations. When I animate an object in MAX 7 using keyframes and simple traslations, I only made 10 frames and set a durration of about 1/3 - 1/2 a second. However, for some reason in dark basic, the animation lengh is increased to over 2 seconds - seems like the animation is playing in slow motion . Any ideas on whats happening here?

BTW, what exactly is an offset object? I don't believe I've ever seen that term before.
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 17th Jan 2005 23:38
"Set Object Culling" isn't a DBC command I've seen before. To do culling, you can use the "Set Object" command, it's in the help files.

What he's saying about offset objects is that if you've got you're gun model, instead of locking to the screen, you use math to position it. And the easiest way to do this is to edit the object so that it is moved away from the XYZ center (offset). This makes it much simpler to position it where it ought to be on the lower right hand of the camera.



"Never put off for tomorrow what you can put off for the day AFTER tomorrow..."

eGeneric Works DB site - egenericworks.com

Login to post a reply

Server time is: 2025-05-24 04:08:44
Your offset time is: 2025-05-24 04:08:44