Skin Mesh Tracks Animation

Started by
1 comment, last by hplus0603 18 years, 1 month ago
Here is my code for setting the Animation with the respective tracks

D3DXTRACK_DESC Desc;
Desc.Enable = true;
Desc.Speed = 1;
Desc.Weight = 0.0;
Desc.Position = 0;
Desc.Priority = D3DXPRIORITY_HIGH;

for (UINT n=0; n<AnimController->GetNumAnimationSets(); n++)
{
    AnimController->SetTrackDesc(n, &Desc);
    LPD3DXANIMATIONSET AnimationSet;
    AnimController->GetAnimationSet(n, &AnimationSet);
    AnimController->SetTrackAnimationSet(n, AnimationSet);
    SAFE_RELEASE(AnimationSet);
}

//To set the track's weight, for example to use track 2
Mesh.GetAnimController()->SetTrackWeight(2, 1.0f);
It can't run the animation that is place at track 2, i used the tiny_4anim.x model that come with the dec_sdk. Only track 0, and 1 seems to be able to work. am i doing anything wrongly?
Advertisement
The AnimationController created by DirectX when you load the tiny_4anim.x file only supports a max of 2 animation tracks. You can play one at a time or blend a max of 2 at a time. So, to play more than two, you need to reassign track 0 or 1 to the other animation sets.
--------------------------Most of what I know came from Frank D. Luna's DirectX books
You can create your own animation controller with an arbitrary number of tracks, although performance may go down.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement