Attaching to Model

Started by
0 comments, last by Endar 14 years, 1 month ago
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
Code makes the man
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.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper

This topic is closed to new replies.

Advertisement