Sign in to follow this  
NiteLordz

Attaching to Model

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this