Sign in to follow this  

Bone movement

This topic is 4553 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'm trying to load a .x file that has bones, and I am trying to rotate, move and transform the bones, but i have no idea how to do that. I don't even know how to get all the bones of a mesh. How do I get all the bones in a mesh and how do I move, rotate or tranform each bone. I appreciate all help given. Thanks

Share this post


Link to post
Share on other sites
Have you checked out the SkinnedMesh sample? It loads a X file, reads all of the bones, and skins the vertices in a vertex shader. However, it is quite complicated and very unclear especially for a sample. If you find that X files aren't sufficient for your animation needs (like most of us), I suggest that you look into an external animation library, such as Cal3D.

Share this post


Link to post
Share on other sites
Skinned mesh is not the same as simple animation at all.

There is no bone example for Managed, but it's fairly similar to the C++ example.

Have you defined your MeshContainer and Frame and loaded your hierarchy?

If not, that's a good place to start.

Share this post


Link to post
Share on other sites
A good place to start learning about xfile animation is here:

http://www.toymaker.info/Games/html/x_file_animation.html

Although the tutorial is not about skinned meshes, it explains the basics of mesh animations pretty well.

good luck...

-fuchiefck

Share this post


Link to post
Share on other sites
Thanks guys. The article really helped a lot. Do you know where i could get a plugin for Animation Master 2002 that exports to a .x file. Or even a free program where you can make models and export them into a .x file.

Thanks for all you help.

Share this post


Link to post
Share on other sites
well I personally use Blender, www.Blender.org, for all my modeling needs and there is a pretty good exporter for it. I have yet to play around with animations in .x files but it has the capability to do them with blender. Good Luck.

Zwig

Share this post


Link to post
Share on other sites
Quote:
Original post by Zwigby
well I personally use Blender, www.Blender.org, for all my modeling needs and there is a pretty good exporter for it. I have yet to play around with animations in .x files but it has the capability to do them with blender. Good Luck.

I second that. Animation software rarely sells at a cheap cost (think thousands of $$$) - it's even rarer that it's free. Normally, the free software is pretty crappy - but I've heard good things about Blender. If you are interested in importing models from other games (ie a Half-Life MDL), I suggest checking out Milkshape. You can import, then export to a common format, then do whatever you want with it, whether it be re-model it or use it in your application.

Share this post


Link to post
Share on other sites
Quote:
Original post by GeekSharp
Skinned mesh is not the same as simple animation at all.

There is no bone example for Managed, but it's fairly similar to the C++ example.


Are you sure?

What is this code in SimpleAnimation for?

for(int iAttrib = 0; iAttrib < mesh.NumberAttributes; iAttrib++)
{
// first, get world matrices
for (int iPaletteEntry = 0; iPaletteEntry < mesh.NumberPaletteEntries;
++iPaletteEntry)
{
int iMatrixIndex = bones[iAttrib].BoneId[iPaletteEntry];
if (iMatrixIndex != -1)
{
device.Transform.SetWorldMatrixByIndex(iPaletteEntry,
mesh.GetOffsetMatrices()[iMatrixIndex] *
mesh.GetFrames()[iMatrixIndex].
CombinedTransformationMatrix);

}
}
[\source]


Share this post


Link to post
Share on other sites

This topic is 4553 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this