Animation blending in DX9

Started by
18 comments, last by Night Elf 21 years, 3 months ago
The DirectX 9 docs mention blending many times, especially in the ID3DXAnimationController reference section. But it isn''t clear (for me, at least) what they are talking about. Is it possible to blend two animations together so as to achieve a smooth transition from one to the other using the new DX9 interfaces? If so, how do you do it? (A source snippet would be great).
Advertisement
I''ve been playing with the Mesh Viewer source code, trying to make tracks 0 and 1 blend but I''ve been unsuccessful.
These are the functions I''ve tried (they all belong to the ID3DXAnimationController class):
- Key/SetPriorityBlend()
- Key/SetTrackAnimationTime()
- Key/SetTrackEnable()
- Key/SetTrackWeight()
- RegisterAnimationSet()
- SetTrackAnimationSet()
I've also been experimenting with animation blending, and like you, I've also been unsuccessful. For some reason I can't get anything other then track 0 to animate. Everything from track 1 and up doesn't work.

Has Anyone successfully blended between two animated tracks?

[edited by - MagTDK on December 26, 2002 12:28:20 PM]
Does ID3DXAnimationController::GetMaxNumTracks return more than 1 track?
Wikkyd~"Do what thou wilt shall be the whole of the Law!"~Aleister Crowley, The Beast 666
quote:
Does ID3DXAnimationController::GetMaxNumTracks return more than 1 track?

Yeah, it returns: 2

I'm loading two animation sets.

I can do this:

      LPD3DXANIMATIONCONTROLLER AnimationController;LPD3DXANIMATIONSET AnimSet;AnimationController->GetAnimationSet(1, &AnimSet);m_pAnimController->SetTrackAnimationSet(0, AnimSet);      


But this only renders track 0. Can't I just render track 1 directly without getting and setting the track?

[edited by - MagTDK on December 26, 2002 1:06:41 PM]
I''ve also been unsuccesful so far with blending animations. I can play different tracks, but whenever I switch animations, the transition is not smooth, it just resets to the new animationset.
I would think this portion of code would blend from track 0 to track 1 but it doesn't.

AnimationController->KeyTrackWeight(0, 0.0f, AnimationController->GetTime(), 0.5f, 0);
AnimationController->KeyTrackWeight(1, 1.0f, AnimationController->GetTime(), 0.5f, 0);

There's something I'm missing

[edited by - MagTDK on December 26, 2002 2:17:40 PM]
How I wish the DX9 docs were complete (or something other than 90% function prototypes).

Anyone planning on writing up a nice tutorial on using the animation classes in DX9? (maybe in C#)
Even before you get to animation blending...how do you export a 3DS model with more than one animation or timeline?

Cheers.
quote:
How I wish the DX9 docs were complete (or something other than 90% function prototypes).


I agree with you, Pseudo. It''s really hard to learn from the DX docs... The only way to learn form the SDK is to decrypt the poorly-commented source code of the samples. Unfortunately they haven''t included an animation blending sample :-(

Thank you all for your replies.
I will keep looking into animation blending and will post anything I find. I hope you do the same.

This topic is closed to new replies.

Advertisement