Archived

This topic is now archived and is closed to further replies.

Looping animation in Skinned Mesh Sample from SDK

This topic is 5572 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

I am not quite sure if this is simple or not... I have removed the tiny mesh and replaced it with my own. How do I stop the animation from looping? I just want the animation to play once, from beggining to end, then for the mesh to render with the last animation frame, and not loop to the begining. I tried to not UpdateFrames, and just DrawFrames, but nothing rendered, (of course). I am a newb. Any wisdom is appreciated.

Share this post


Link to post
Share on other sites
The SDK example purposely loops the animation, so you''ll have to go into the code and modify it. Look for the timeGetTime function call that is used to determine which time to use for the animation and change it to something you can work with.



Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX

Share this post


Link to post
Share on other sites
Hi Jim:

I have read over your RPG games with DirectX. I''m still wondering how I can use the .x file. How can I animate bones? My friend has given me a .x file created from Maya 4. Your book shows a sample of how to load it and rotate it, but how can I make use of the bones for the 3D character and move for example, it''s arms and legs, etc.

Also, if they include animation in the .x file, how can I load it so that it will automatically display all the animations?

Share this post


Link to post
Share on other sites
quote:

Your book shows a sample of how to load it and rotate it, but how can I make use of the bones for the 3D character and move for example, it''s arms and legs, etc.



You need to alter the matices in the bone hierarchy. Using pre-created animations is the easiest way to do this. Animations are contained in AnimationSet templates within the .X file. From my book, you can use the cAnimation class to load and use animations in conjunction with the cObject class. Check out chapter 10 for some details on using the Game Core, or check out the source for chapter 16''s demos or chapter 20''s game demo.



Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX

Share this post


Link to post
Share on other sites
Hey thanks Jim!

Searched the code for time.

I just had to turn off:

pframeCur->SetTime(pdeCur->fCurTime);

So If you know the amount of animation frames, just turn off this call at the last one.

Share this post


Link to post
Share on other sites