Jump to content
  • Advertisement
Sign in to follow this  
NiteLordz

Attaching to Model

This topic is 3121 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Currently, i have an x file loading in, api independent, so i don't want any dx specific code, but i have an x file that loads in, and i wish to attach another model to the skinned model. picture a model that will place a gun on its shoulder ( ex. Predator Movie ). I know i need to need to name the bones with attachment, or some variation, so that i can find them when loading. I have been looking for an example of this, but i can not find any good resources that explain this in detail. Thanks much

Share this post


Link to post
Share on other sites
Advertisement
I don't know of any resources on the web, but you basically want to name the bone with a name you can use to query and get the calculated world matrix of the bone every frame. After that, simply set the transform of the attached model to be the one queried from the bone. But in order for this to work properly, the origin (or root bone) of the attached model will have to be where you want it to attach to the larger model. You can get it to attach to a different bone on the attached model instead of the root bone, but that would require another step of math to add on another transform of the other bone on the attached model in the model space of the attached model.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!