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.

Dark GDK / Mount points on models

Author
Message
Crasher
11
Years of Service
User Offline
Joined: 30th May 2012
Location:
Posted: 30th May 2012 08:53
Hello all,
sorry if this question has been raised before, spent a bit of time searching but couldn't find what I need. Basically I am working on a game with ships/robots that will have mount points for weaponry and equipment and will be able to move and rotate in all directions. My question is what is the best or simplest way to define a mount point on an object or model, secure the weapon to the mount point, and make sure it behaves correctly, i.e. moves and rotates along with the model it is mounted on. I am using 3ds max to make models if this helps.
Thanks
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th May 2012 16:54
I'm assuming you're using bone animation for your main character, yes? Add a "dummy" joint to the skeleton at the point where you want the weapon to be held. When you export the model, each joint will have an index, so make sure you remember which index the dummy joint has.

After that in your code, use this to attach the gun to the joint:

dbGlueObjectToLimb( objectID , TargetObjectID , JointIndex )

Note that dbPositionObject() is relative to the joint position and rotation. If you see that the gun is crooked, then open up your character model again and rotate the dummy joint to compensate.

TheComet

Crasher
11
Years of Service
User Offline
Joined: 30th May 2012
Location:
Posted: 2nd Jun 2012 12:54
Thanks! After a bit of fooling around in 3dsMax I figured out how to do joints, just normal bones. Putting that model in was easy and adding another object to the joints using the command worked a treat. Potential pitfall was rotating and pointing a glued object didn't work but a work around is getting the limb position of the object using the dbLimbPositionX/Y/Z commands, positioning your turret object at those coords and doing any rotations and points you want. I plan to use my new found knowledge to put turrets on ship models and point them at targets.

Login to post a reply

Server time is: 2024-04-19 02:51:04
Your offset time is: 2024-04-19 02:51:04