Jump to content
  • Advertisement
Sign in to follow this  
Unfadable

Math for adding attachments to an animated mesh

This topic is 3161 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

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


Link to post
Share on other sites
Advertisement
Quote:
Original post by Unfadable
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.


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


Link to post
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]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!