XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

SkinnedModel: replacing meshes.

Last post 28/08/2008 18:56 by emzic. 4 replies.
  • 27/08/2008 23:07

    SkinnedModel: replacing meshes.

    hello,

    i am using the skinnedmodel-tutorial to animate characters in the game.

    now what i would like to do is to replace one of the meshes in my model with another one.

    for example the character has normally a box on his hand, which would be replaced by a sword.

    i already figured out how to remove the box but i cant find out how to get the correct transformation matrix for the sword.

    how can i do this?

    thanks a lot!

  • 28/08/2008 0:38 In reply to

    Re: SkinnedModel: replacing meshes.

    Find the Bone by name in the Model.

    Find the BoneIndex from that bone.

    That's the index of the matrix that you want to use for the sword, in the array you get out of CopyAbsoluteTransformsTo().


    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 28/08/2008 10:31 In reply to

    Re: SkinnedModel: replacing meshes.

    thanks a lot! i found the bone and got the matrix, but when i set the transform of the sword to that matrix, it just doesnt move with the animation but stays where it is. what am i missing here? thanks!
  • 28/08/2008 18:37 In reply to

    Re: SkinnedModel: replacing meshes.

    That depends on what animation runtime code you're using. You should copy the matrix from the same array that is sent to the effect/shader for skinning. Remember to also multiply in the object World matrix, if the matrix array is in object space.

     


    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 28/08/2008 18:56 In reply to

    Re: SkinnedModel: replacing meshes.

    thanks for your reply. i am using the animation code from this tutorial: http://creators.xna.com/en-us/sample/skinnedmodel multiplying with the worldmatrix doesnt seem to change anything. thanks a lot!
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG