Skip to main content
gamedev.net
🔒 Locked

animationcontroller

Started by danromeo Oct 29, 2004 at 8:45 AM 1 replies 550+ views
Original Post
danromeo
danromeo
Can anybody give me a basic idea of how the AnimationController works? I have an .x file containing animations loaded, and the animation plays, but I can't figure out how to get any control over it. How can I tell when the animation is at the last keyframe? How do I set the animation back to the first keyframe? How do I make the animation loop? ALSO...this is what's really stumping me...as I said, the animation plays, but currently it's going through a single iteration of the animation, then it just sits there for a LONG time, then it replays the animation. Why isn't it simply looping through the animation over and over again? This is the code I'm using: m_pAnimationController->AdvanceTime(fElapsedTime); where fElapsedTime is being calculated at the beginning of my FrameMove function. ALSO, I found a code snippet in an article on this site: m_pAnimationController->SetTime(m_pAnimationController->GetTime() + fElapsedTime); which looks like it would do the trick, but lo and behold, m_pAnimationController->SetTime is NOT included in DX9. WTF, over? Bottom line, I think I'm simply not understanding the timing functions for the AnimationController. I.E., How Do I Do This? Thanks a lot. This forum is awesome.
circlesoft
circlesoft
Yep, the animation controller included with D3DX is very confusing, partly due to the complexity of X-files. Microsoft is working on it, but don't expect a new file format and new set of animation interfaces before DX10 (WGF 2.0).

However, there *is* good news. DirectMesh implements interfaces that are very simple and easy to use (calls like IMesh::SetAnimation() and IMesh::Play()). Also, some great new features are being added to DM 2.0.
DrGUI
DrGUI
I haven't quite got my animation working yet (posted on a few threads on it just now) so sorry I can't help, but AdvanceTime(elapsedTime) and SetTime(...GetTime + elapsedTime) should have exactly the same effect.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.