• Advertisement

Archived

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

Keyframe/Body Animation

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

Hi, I would appreciate some help. I’ve gotten quite a bit with my DirectX 8 game engine, but on thing that definitely is far from perfect is the animation of meshes loaded from .x files. Looking at the sample of the skinned mesh doesn’t help me much to understand how it works. Does anyone know of tutorials concerning animation of meshes in DirectX 8?

Share this post


Link to post
Share on other sites
Advertisement
Hahaha. I have the exact same problem. I came up with two solutions:
1) Read up about x files. Understand the format then you will understand the tiny demo that demonstrates skinned meshes. Unfortunately, .x files are a templated language, so learning thme is kinda like learning a new programming language.
2) Use a more readable format such as milkshape3d. With ms3d files, you can read in animations (you can even have them stored in ascii format!) The best tutorial/library for loading ms3d animations is Brett Porter''s: http://www.rsn.gamedev.net

There is even a forum for Real Soon Now Productions (brett''s company (?) )

DmGoober

Share this post


Link to post
Share on other sites
The skin mesh example is really an all-in-one that tries to demonstrate all the features you can use. At the same time it overwhelms you at first. This is one of the topics covered in my book.

First, just concentrate on using blended index meshes. The skinmesh object itself sucks - it''s software based and slow. The only reason for using it is to construct an indexed mesh.

The idea of an indexed mesh is that you create a ''palette'' of 3d data that you draw in one swoop. Each palette can have its own matrix, which is used to blend into a main matrix. This is to compensate for bones and bone weights.

When dealing with an .X file, you need to read in the frame hierarchy, which represents the bones as well. These frames only have matrices attached, with a single mesh in there (should only be one to make it efficient).

Create a linked list of frames, giving each child frame the parent''s matrix to work from. As you animate, just combine the frame matrix with the parent frame matrix to come up with the new one to use.

That''s about the idea of it, and I would like to go into detail, but that wouldn''t leave me much for my book I''m going to try and get permission from my publisher to start posting some example programs (exe''s only) to start showing off what''s going to be in the book).


Jim Adams


Jim Adams
Author "Programming Role-Playing Games with DirectX"
jimadams@att.net

Share this post


Link to post
Share on other sites
Yes, as Jim stated the code is very inefficient in the skinned mesh example. But if you look at exactly what is happening its not to hard to figure out. An example of its inefficiency is it that it actually loops through all of an objects key-frames from the very first one, and only when it finds a frame with a higher time value does it use this as the interpolator... Okay maybe its not that bad, but if an object has a lot of frames it could get costly. Its much better IMO to keep track of the currrent key frame and start from there.
I have not seen any tutorials on how to do the animation on the web, what are you having trouble with ?

On a side note... I am very near to being finished with my skinned mesh exporter for truespace. I got tired of waiting for someone else to code one. It will be text only for a short while, but already it exports much more reliably than the ones for 3dsMAX. I just need to do some more work on the skin weights.

Share this post


Link to post
Share on other sites

  • Advertisement