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

Robot Game Model Not Animating

Last post 29/08/2008 14:36 by FireFly. 0 replies.
  • 29/08/2008 14:36

    Robot Game Model Not Animating

    Hi, I am trying to get the robot game models to work with the skinning sample however i am facing some problems. The .Animation file is being read in and then turned from keyframe sequences to skinning data keyframes. Then i am doing everything else like the skinning sample but instead of using the skinning sample skinning data i am using the normal model.Bones data. It runs fine without errors however the model doesnt move, it stays in the bind pose. I think it may be because of the way im adding the keyframes to the keyframe list.

    foreach (KeyFrameSequence keySequence in sequence.KeyFrameSequences)  
    {  
        Quaternion rotation = Quaternion.Identity;  
        Vector3 translation = Vector3.Zero;  
        Vector3 scale = Vector3.Zero;  
     
        for (int i = 0; i < keySequence.KeyCount; i++)  
        {  
            // Get the keyframe sequences rotation, move and scale matrix then combine them  
     
            Keyframe keyframe = new Keyframe(model.Bones[keyBone.BoneName].Index,  
            TimeSpan.FromSeconds(keySequence.KeyInterval * i), keyFrameMatrix);  
     
            KeyFrames.Add(keyframe);  //List
        }  
    }
     

    However in the list the keyframes are coming out sorted into which keyframe sequence they come from not in time order. e.g.

    [0] Bone 33 Time 0

    [1] Bone 33 Time 0.03

    [2] Bone 33 Time 0.06

    [3] Bone 2 Time 0

    instead of

    [0] Bone 33 Time 0

    [1] Bone 2 Time 0

     

    How do I fix this problem? I have tried sorting them by comparing the times however when i do this the model dissapears.

     

    *Edit* Hi, please disregard this post as the contents is invalid, this is not my problem

Page 1 of 1 (1 items) Previous Next