#### Archived

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

# Skinned Mesh Tutorials?

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

## Recommended Posts

Hello, I''m sure it''s been discussed before...but does anyone know where I can find a tutorial of some sort on how to use the Skinned Mesh in D3DX library? Can''t find any on this site... Cyelince

##### Share on other sites
What, the one that comes with the D3DX 8 SDK isn''t good enough? just kidding, i love how they put practically ZERO comments in, so you are just looking up function after function to know what is going on. I am only hoping SOMEONE out there will help hold our hands through skinned meshes, ''cause they aren''t looking too simple to me

##### Share on other sites
The concept is actually quite simple. If you have a single root bone, all other bones are children of that bone, or children of it''s children. It''s just like a tree. So, when one bone is rotated, it''s children also get rotated, and thier children get rotated, etc. So, if you have a bone structure:

BoneRoot, BoneChild1, BoneChild1Child1, BoneChild2
where BoneChild1 is a child of BoneRoot, and BoneChild1Child1 is a child of BoneChild1, etc.

Rotations are then recursive. You walk the tree, from root to children, building rotation matrices. At each node, a Bone simply ask that it''s parent for it''s final rotation matrix, and multiplys it against it''s own local rotation matrix. Somewhere in there you have to multiply the matrices to translate them from thier current positions, to the origin, and then back (so the rotation works correctly), but that is about all there is to a simple bonme structure. You then modify the vertex buffer(dont change the index buffer, though) with the final rotation matrices, applying them to the vertices the bones affect.

The only really hard part is figuring out how to load them from an X file. It is really much easier to write your own system.

Z.

##### Share on other sites
Yes, I do have the concepts down pretty well...I was just wondering if there was a specific place that documented how to use ID3DXSkinMesh. I know I can nail through it by testing out the interface and trial and error hours after hours.

But if we could just get a simple tutorial on how to use them that''d be great...Heck, if I figure it out, I''ll submit one to Gamedev. They sure do need one, with all the Direct3D books not even attempting to cover it. And the ''tutorial'' MS provides is some crazy non commented code as GyCot mentioned. And the SkinnedMesh sample is one of the only code samples that does NOT have a "readme.txt".

And Zaei, if you know how to use skinned meshing, what methods do you use, do you just use straight vertex buffers in a custom mesh? Or what do you use? If you could tell me any books or tutorials you read that helped out, I''d appreciate it!

Thanks,
Cyelince

##### Share on other sites
I havent written my code yet, but I plan to use a custom model format, for two types of skinned meshing, a detailed version (with bone weights, etc), and a simple version. Probably will use a simple VertexBuffer/IndexBuffer/tri-list format for simplicity.

Most everything I know about skinned meshes comes from my 11 hour stint trying to recreate the SkinnedMesh tutorial (FYI, from the coding style, that sample was written by at least 3 people =), and then debugging it. I got the mesh loaded, and got it to draw, but it wouldnt move.

I know that the new book "Programming Role Playing Games with DirectX 8" includes a tutorial on loading skinned meshes (it is being written by the guy who wrote the two X file parsing tutorials for GameDev).

Z.

##### Share on other sites
Oh, one of the best pieces of advice i can give you is to print the entire SkinnedMesh Sample, and try to re-create it from there.

Z.

##### Share on other sites
Yeah, I have been having some trouble with skinned meshes myself, amount other things. Can someone please tell me how?

-stumpted and confused

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 11
• 37
• 12
• 12
• 11
• ### Forum Statistics

• Total Topics
631413
• Total Posts
2999945
×