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

Bones not Rotating

Last post 08-31-2008 10:18 PM by FireFly. 3 replies.
  • 08-29-2008 10:25 PM

    Bones not Rotating

    Hi,

    I am using the skinning samples animation player and .fx Shader to make a model animate however its not working properly. I have an array of the bone transforms and i am sending them to the effect like the sample.

    bones = clipPlayer.GetSkinTransforms();  
     
    foreach (ModelMesh mesh in model.Meshes)  
    {  
        foreach (Effect effect in mesh.Effects)  
        {  
            effect.CurrentTechnique = effect.Techniques["Diffuse"];  
            effect.Parameters["Bones"].SetValue(bones);  
            effect.Parameters["View"].SetValue(view);  
            effect.Parameters["Projection"].SetValue(projection);  

        }  

     

        mesh.Draw();  

    I have checked these and they seem to be fine. However the only transformations being applied are the ones on the root bone i think as shown here : http://www.youtube.com/v/pkLOGcm4QFM. What should be happening is the Robot should be walking, not just bobbing up and down. Is there a way to see if all the transformations are being applied or how to fix this?

  • 08-29-2008 11:52 PM In reply to

    Re: Bones not Rotating

    Does the shader actually do skinning using the Bones array?

    Are the vertices, or mesh pieces, actually bound to different bones?

    You can easily debug what's going on by running in PIX for Windows. It lets you capture a whole frame of calls, and then go back and analyze that call stream. You can open up a render, right-click on a pixel, and choose "debug this pixel" to be able to debug both pixel and vertex shaders that contributed to that pixel.


    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 08-30-2008 10:54 AM In reply to

    Re: Bones not Rotating

    Hi,

    yes the shader does do skining using the bones array and im not sure about the vertices and mesh question as its not my model, its the Grund model from the Robot mini game using the Low_Walk.Animation. I know that the shader works as i have another model using it and its animations work just fine. I have decomposed each of the matrices in the bones array and they all have the correct rotations. The model is just not responding to them. Is this a problem with the model?

  • 08-31-2008 10:18 PM In reply to

    Re: Bones not Rotating

    Ok, I think i have found the problem with this, I have used pix to debug my shader and it appears that the model (grund) hasn't got any BoneWeights or BoneIndices. I haven't altered this model at all since I pulled it out of the robot game. Can anyone tell me if any of the Robot Game Mini Game Mech models contain any BoneWeights?

    Thanks

Page 1 of 1 (4 items) Previous Next