Archived

This topic is now archived and is closed to further replies.

Raeldor

Character holding an object

Recommended Posts

Raeldor    254
Hi, I have sucessfully programmed my skinned mesh routine in DirectX, and it works pretty good. The next thing I want to do is render an object (another mesh) in the hands of the player. What is the best method for doing this? Should I walk down the chain building the transform looking for a preset bone name? How do you (professional) guys do it? Thanks Rael

Share this post


Link to post
Share on other sites
Lestat3D    122
Hi,
I''m not a pro but I have solved this problem quite time ago.
You have to attach new bone to the character''s hand, that bone holds the local transformation matrices of the object you want to attach.
If you made the skinned character as an object hierarchy in a tree manner it''s gonna be too much easy to do.

Share this post


Link to post
Share on other sites
Raeldor    254
Thanks for the reply. Is that a new bone in addition to the existing hand bone? Would the object I attach not already have transformation matrices of it''s own?

Thanks again

Rael

Share this post


Link to post
Share on other sites
Lestat3D    122
If the object you want to attach does not have transformation matrices you have to construct your character leaving a not visible node attached to the hand, then you only have to assign that bone transformations to the object you want to attach avery time you update the bones.
But the best manner of doing this is to make the object you want to attach an object derived from the base node class you used to construct your character and to assign its transformation matrices before you attach it, so the absolute transformation matrices of this object is updated automatically with the rest of the nodes.

Share this post


Link to post
Share on other sites
Raeldor    254
So let me see if I understand you correctly. You are saying that I should attach the objects mesh node to the bone that will be holding the object, so when it walks down the tree to calculate the transforms it will be done automatically?

Share this post


Link to post
Share on other sites