Archived

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

Skinned Mesh Hierarchy

This topic is 5217 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

When studying skeletal animations I came across two methods how to store the bone hierarchy. The first is a simple tree structure where each bone is defined like this: ( Look at D3DXFrame and the X File format for an example )
struct Bone
{
// Matrices, Meshes and what else is needed

// Child pointer

std::vector<Bone*> m_Children;
}

Or the hierarchy is stored as a vector where each bone only knows its parent. As far as I understand this sorage theme the vector is sorted such that a parent will never follow a child. Md5 files( Doom 3 ) are stored in this way for example. This lets you update the hierarchy by simply iterating a vector instead of recursivly traversing a hierarchy.
struct Bone
{
// Matrices and all this stuff

// Parent index

int ParentIndex;
}

1. Is there any operation that only can be done with the first method ( e.g. FK, IK or something else )? 2. What are the major advantages / disadvantages of both methods when used in an application ( Speed, maintainability, robustness, ... ) ? 3. Is there any difference but how the hierarchy is traversed ( Loop vs. Recursion ) ? Any help is appreciated! -Dirk [edited by - DonDickieD on June 9, 2004 4:33:04 PM] [edited by - DonDickieD on June 9, 2004 4:33:58 PM]

Share on other sites
Inside your engine, storing an array of child nodes is the way to go, mainly for forward kinematics reasons.

In your files however you only need to store the parent, because that means you can automatically determine that the bone you load is a child of that parent. That way you can construct the array of child pointers.

That would also be possible inside your engine, after load time, but that would be pretty slow of course.

With FK you need to start at the root node, and traverse down the hierarchy into the child nodes. If you still have to find what the actual child nodes are, that would slow down a lot.

Cheers,
- John

Share on other sites
Thanx John,

that is what I guessed. Would you agree that if I only use keyframing than the parent node are a little more convinient? The hierarchy update would be simply two vector iterations like this:

for_each( node ) UpdateTransformationMatrix();
for_each( node ) MultiplyWithParent();

This is (at least when your are not familiar with recursion) a little more understandable - IMHO.

Can you give a short example why you can''t do IK whith the parent node? I only know FK and IK from Dynamic so I have a pretty good idea what is does, but no experience how it is implemented regarding character animation. A small example could help a lot.

Best regards

-Dirk

Share on other sites
you can see how I did it in: http://www.zenerd.com/zengeneral/code.html

under Character Animation

Share on other sites
Hi Dirk,

That would work as well if indeed you construct your array/stack of nodes upfront.
Also when you are going to attach objects to your nodes, you will need to update this array. When you are not using recursion the way you mentioned works very well.

However, you will have to store an array with the correct hierarchy traversal, so when it comes to memory storage, I dont see much advantage over your method. And it requires some extra management. But when you deal with purely static characters, or you can automate this updating of the traversal order array, then I see no reason why not to choose your method.

Performance wise the parentID method is faster, since you don''t need recursion.

When you start doing some procedural control on bones, some algorithms require you to know the child nodes. However, you can in most cases also precalculate them when you create such a controller, so that also won''t really stop you from doing the parentID method. I never said you cannot do them I just assumed you would be using recursion for your hierarchy when doing FK.

There are several different IK algorithms, they all work different. You have algorithms that start from the end effector and use the parents to go up the chain. Others would start at the root going towards the end effector. But you can also precalculate a special array for traversal there.

You can see some of my anim system at http://www.emotionfx.com
Still have to update the website with movies etc though, but will happen soon Feel free to drop me a mail if you have any questions.

- John

Share on other sites
Hey John,

I worked at the university and we researched emotions in the human motion. Maybe this is interessting for you system and you like to have a look? Can I send you an e-mail to any of the *@mysticgd.com adresses?

Cheers,

-Dirk

PS: I always loved that model :-)

[edited by - DonDickieD on June 10, 2004 7:00:29 AM]

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
13
5. 5

• 9
• 13
• 10
• 9
• 17
• Forum Statistics

• Total Topics
632601
• Total Posts
3007354

×