Animation Tweening Between KeyFrames - I.E. Smooth Animation!

Started by
20 comments, last by HexSkillz 20 years ago
I have a .X Model Which has a few keyframes in it I'm using AnimationController to animate this model but I face two problems: 1. The Animation is extremely fast 2. There's no tweening between frames and this model requires tweening between frames to function properly Could Someone please help me out and tell me what I need to do to accomplish these two things using ID3DXAnimationController Thanks, -jason [edited by - hexskillz on April 8, 2004 5:55:51 PM]
Advertisement
well, i can''t help you out completely yet, cause im studying this now as well, but essentialy what you need to do is blend between keyframes.

what this means is if for example you have a vertex at x=0 and at the next keyframe, after 10 seconds it''s at x=10, then it''s position after one second should be 90% of x=0 and 10% of x=10, so new_x = (0.9 * 0 + 0.1 * 10 ), this will place the new_x at x=1. after another second it''s 80% and 20%...so new_x = (0.8 * 0 + 0.2 * 10), so the new_x is 2...your''e whole path between 2 keyframes is 100%...you just figure out a general formula to transform/rotate each vertex, and decide how many % of animation is advanced every time unit u decide (second for example).

this is just what i got from reading for a few minutes...im not 100% sure that this is right, though it seems reasonable to me.

hope this helps..
Try looking at the Dolphin sample in the DXSDK, I haven''t taken a close look at it but I know it uses vertex tweening.
Get the "Advanced Animation With DirectX 9" book by Jim Adams. It will save you a lot of time.
Thank you for your responses

I am aware at how to calculate the mid positions between frames manually although right now i'm not at that option unless i choose to write my own animation controller. I am quite certain that the animation controller can do this however I can't firgure out how.

I'm guessing you need to enable 2 animation tracks and use one of their blending properties? Some code would help me out.

The Dolphin example does not do animation tweening between keyframes rather it uses 3 seperate meshes and tweens between these seperate meshes without the animation controller.

I would definitly like that book! however its not availible to a me near a local store right now and buying it over the internet is not an option.

I'll be able to order it from my store probably - I'm not sure quite yet.

Thanks,
-Jason


[edited by - hexskillz on April 5, 2004 6:47:12 PM]
Jim''s book is pretty good but he sure makes it harder than it needs to. Just check out gamedev''s out little animation article. It is about all you need. Jim goes into his own animation blending code, but it is already but in dx so I don''t know why. Also I have seen his in action and dx''s in action, and they appear nearly identical. So he made a 200 page answer out of which could have taken a small tutorial.

http://www.gamedev.net/reference/articles/article2079.asp

I fail to see the "tweening" part of that article (which is the article that got me to this point where i am today)
The animations controller has a keyframe setup I believe.

KeyframedAnimationSet

here are 2 ok links. Dx has the support, it is just a matter of using it. Since the tutorial is a good start and it sounds like you have it loaded, just look into setting up the controller using one of these.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.direct3d/c/keyframedanimationset/m/ctor.asp


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.direct3d/c/keyframedanimationset/keyframedanimationset.asp
Also check into this

http://www.gamedev.net/reference/programming/features/vertextweening/page2.asp
I appreciate your help although I still don''t think you know what I''m looking for.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.direct3d/c/keyframedanimationset/m/ctor.asp

I''m using Unmanaged C++ not .NET although even so KeyframedAnimationSet provides no way of tweening animation key frames. I''m quite aware on how to play back animations without tweening.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.direct3d/c/keyframedanimationset/keyframedanimationset.asp

Once again i''m not using .NET however that just looks like a ID3DXAnimationController but posting a reference to ID3DXAnimationController isn''t any help at all; i''ve looked at it continously and i''m asking how to use that interface to produce animation tweening.

http://www.gamedev.net/reference/programming/features/vertextweening/page2.asp

I''ve seen this before too this still doesn''t provide help on

"tell me what I need to do to accomplish these two things __using__ ID3DXAnimationController"

Using that form of animation tweening would require me to disect the ID3DXMesh too much.

thanks
-Jason

This topic is closed to new replies.

Advertisement