Jump to content

  • Log In with Google      Sign In   
  • Create Account


Mesh swap in XNA Animation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Tasaq   Members   -  Reputation: 1194

Like
4Likes
Like

Posted 10 December 2012 - 04:43 AM

Hi,
I am learning how to skin meshes (never have I done it, so I think it's high time o.O), I am using ported XNA Animation Component Library to XNA 4.0. Everything works fine except one thing. I want to be able to swap meshes inside a model (for instance, say my character is a sword master, and I want to change his weapon in hand). I noticed that XNA animation requiers for all objects in my file to have weights (which I am not sure about). I am also using custom effects.
So do you have any ideas how to change mesh inside model with XNA animation (i.e. swap it with mesh from other model)?
I also want it to be animated so I need to create animation inside character model for my weapon Posted Image
EDIT:
Solved it, took me a lot time yesterday to search the internet and after posting a topic on gameDev i solved it in few minutes :)
For those who want to do same thing as I do and don't know how:
In my weapon file I created a bone named the same way as in my character model and I added skin modifier to the weapon and added that bone(I am not sure if it is required). then in XNA:
sword.World = character.modelAnimator.GetAbsoluteTransform(character.modelAnimator.BonePoses["weapon"].Index) * character.World;
(sword and character are objects of my class to store info that I use, like materials, animations etc.).
I also add a flag for proxy weapon in character model to not draw it :)

Edited by Tasaq, 10 December 2012 - 05:41 AM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS