# Math for adding attachments to an animated mesh

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

## Recommended Posts

Hi, So I have an attachment (say an arm shield) that I need to attach to an animated mesh (say offset from the wrist). The attach point is specified in model space according to the mesh's base pose. While the mesh is animating, I need to determine the model space's position and orientation of the attach point. My thought is to determine the relative offset and orientation of the attachment according to some bone (in model space). Then during the animation, I use the bone's model space position and orientation to come up with my attach point's model space position and orientation. Questions: #1. Coming up with my offsets according to the reference pose. Is the initial relative offset: attachPosition - RefPoseBonePosition? Is the relative orientation: Inverse(RefPoseBoneOrientation) * attachOrientation? #2. To determine my attachment's model space position and orientation, I should just multiply my attachment's relative offset by the model space bone matrix. Correct? #3. If I'm supplied a position and orientation, is it correct to just plug these straight into a matrix to create the proper transform? #4. I'm somewhat limited by the functions available to me, but is there other ways to do this? Is the reference pose even needed for what I'm trying to do? Thanks, - U edit: I was confusing two different approaches I was trying. I updated my 2nd question, so its just one approach now. [Edited by - Unfadable on October 24, 2009 11:45:13 AM]

##### Share on other sites
Quote:
 Original post by UnfadableMy thought is to determine the relative offset and orientation of the attachment according to some bone (in model space). Then during the animation, I use the bone's model space position and orientation to come up with my attach point's model space position and orientation.

All I saw was the word bone. Make a new joint with the proper orientation for any point you intend to attach new meshes to.

##### Share on other sites
Hi,

Thats a good idea of course, but is just not an option for me in my situation.

Let me simplify my question.
I would like to find the relative offset of my attachment from a particular bone. Is the relative position: attachPosition - RefPoseBonePosition? Is the relative orientation: Inverse(RefPoseBoneOrientation) * attachOrientation?

edit:
After thinking about it, relative position should be attachPosition * Inverse(RefPoseBoneOrientation).

Relative orientation shuold be attachOrientation * Inversed(RefPoseBoneOrientation)

[Edited by - Unfadable on October 26, 2009 8:01:46 AM]

1. 1
2. 2
3. 3
Rutin
21
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633654
• Total Posts
3013171
×