Looping animation in Skinned Mesh Sample from SDK

Started by
5 comments, last by Green 21 years, 7 months ago
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.
Advertisement
Search "skinned mesh" in this forum. There are some usefull posts about this example. It is not straight forward though.
I would love going home to M7, but I can't detect black holes.
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

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?
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

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.
Thanks Jim.
Too bad the CD no longer works.
I''ll try to see if there is any other alternatives.

This topic is closed to new replies.

Advertisement