Jump to content
  • Advertisement
Sign in to follow this  
glsensor

smooth blend multi-animation

This topic is 4160 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A character animation has WALK, RUN, FIRE..etc. D3DXAnimationController support two key tracks, we can easy to do from WALK to RUN smooth transform, but how to do from WALK+FIRE to RUN+FIRE smooth transform. Is need more key tracks? I mean is blend and smooth at same time, WALK+FIRE is blend and need two working tracks, but WALK to RUN is smooth transform that need two working tracks too, How does D3DXAnimationController do that?
DWORD dwNewTrack = ( dwCurrentTrack == 0 ? 1 : 0 );

LPD3DXANIMATIONSET AnimSet = NULL;
pAnimCtrler->GetAnimationSet(RUN_ID, &AnimSet);
pAnimCtrler->SetTrackAnimationSet(dwNewTrack, AnimSet);
SAFE_RELEASE(AnimSet);

pAnimCtrler->UnkeyAllTrackEvents( dwCurrentTrack );
pAnimCtrler->UnkeyAllTrackEvents( dwNewTrack );

pAnimCtrler->KeyTrackEnable( dwCurrentTrack, FALSE, TimeCurrent + TRANSITION_TIME );
pAnimCtrler->KeyTrackSpeed( dwCurrentTrack, 0.0f, TimeCurrent, TRANSITION_TIME, D3DXTRANSITION_LINEAR );
pAnimCtrler->KeyTrackWeight( dwCurrentTrack, 0.0f, TimeCurrent, TRANSITION_TIME, D3DXTRANSITION_LINEAR );
pAnimCtrler->SetTrackEnable( dwNewTrack, TRUE );
pAnimCtrler->KeyTrackSpeed( dwNewTrack, 1.0f, TimeCurrent, TRANSITION_TIME, D3DXTRANSITION_LINEAR );
pAnimCtrler->KeyTrackWeight( dwNewTrack, 1.0f, TimeCurrent, TRANSITION_TIME, D3DXTRANSITION_LINEAR );
pAnimCtrler->SetTrackPosition( dwNewTrack, 0.0 );

dwCurrentTrack = dwNewTrack;

The code do WALK to RUN smooth only. How to blend FIRE in it. Thanks in advance. [Edited by - glsensor on February 1, 2007 2:36:44 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!