Skinned Mesh Animation

Poncho843

Newcomer
Joined
Nov 4, 2004
Messages
12
Location
Daventry, England
Hello all, i am desperate for someone to help me. I have downloaded every piece of source code i can find and all have the same results - when i try to create a skinned mesh and load the animation, with tiny.x the whole body moves rigidly as if it were just 1 bone, and my own creations (exported from milkshape) appear as the default pose with no animation at all.

The annoying thing is when the meshes are loaded into mesh viewer the animations are perfect. Is there something obvious that i am missing??? Some guy on another thread, i can't remember which now, converted the skinnedmesh c++ code into vb.net and i used that to no avail - i have attached the whole project, if someone could please take a look at see if there are any obvious problems with it.

I have vb visual studio.net 2003 and directx 9 october 2004 release (which i haven't got anything to work with yet)

I know i'm asking a lot, and i do apologise, but i am at my wits end.

Thank you all very much in advance
 

Attachments

Cheers Pentium Guy, looked at that site before, and like you said is completely incompatible with any recent release of DX9. Was hoping there was a way without reverting to an older version of DX9 but if the only way forward is backward then so be it. I believe the phrase rhymes with clucking bell!! :-\
 
Sigh man, I've tried to 'upgrade' the code to the latest version. No luck. MS has changed too much, it's almost as if it's a new version number (9 -> 10 lol).

I have an idea btw. I'm going to try this too...
I'll look in the documentation and see what has changed since version 9.0a (I have 9.0a, b, and c)... and chart the changes and see if I have any luck.

-The Pentium Guy
 
I don't have 9.0a which has always been a problem to me when looking for examples. Looking into getting the December 2004 release but not convinced that will make any difference so i have downloaded it but not installed it yet. Tempted to go back to 8.1!!!!!

I've have had some mini-progress though. Exported my meshes from MilkShape using two different algorithms - first one the mesh is fine but no animation, second one the animation is fine but the mesh is messed up, so i'm going to have a look and see if i can combine the two from the ascii files - very odd, but a lot further that i got before.

Will post the changes when/if i fine them
 
ThePentiumGuy said:
This is really annoying. I don't think the source code works on my 9.0a anymore.... it used to work. This is really, really annoying.
I gave it a few hours last night - honestly I couldn't get anywhere. I'm really not too sure where to start either.

The annoying thing is when the meshes are loaded into mesh viewer the animations are perfect.
Time to get the code for the mesh viewer :P.

-TPG
 
I discovered the exact problem behind the distorted mesh when animating. It didn't convert it to a single mesh, so every bone had it's own mesh and as a result were disjoint, no vertex blending or anything vaguely skinmesh'y about it.

How to fix it, i don't know, but i've made my milkshape importer manipulate the vertices and bones itself without ConvertToIndexedBlendedMesh or any reference to AnimationController or Hierarchy. It's pretty specific code to milkshape, but it works a treat.

Will tidy up, comment the code and post it if anyone is having the same problem.
 
Pentium Guy,

I haven't got the code ready for the world yet, but if you're interested, here is the most insightful document i have read on animation and meshes with directx 9 - didn't use any of the code, but the theory makes everything clear.
 

Attachments

Hey,

I have a present for you :). My friend lent me (a while ago actually, I think I gotta return it) Sams Managed DirectX 9. I looked through that book and guess what? It discusesd skinned mesh animation.

Guess what also? It actually works.

Here's the catch:
It doesn't work with directx 9.0a
It doesn't work with directX 9.0c

It works with 9.0b. I'll post this as soon as I can. It uses that tiny.x model which came with the SDK and is faily easy to understand.

I tried converting it to directx 9.0c, but I'm not sure what to do with a 'MustInherit' class. I'll try to create my own class which inherits this or something. I'm not that great wtih OOP.

The good thing is: Microsoft did not write this code. So it's really easy to understand :D.

I'll upload this soon.

-The Pentium Guy
 
Heh. I'm working on upgrading it to 9.0c,
I'm getting gay errors like:

Must be overriden.

So I override it. It complains about something and it says it cannot be overriden, it must be overloaded. So I freakin overload it. Once I overload it, it complains about the class, saying it must be MustInheritable. So I do that. Then it complains saying that I cannot instantiate a MustInheritable class. So I remove the 'New' keyword. No errors.

It obviously won't run. NullRefernce Error. I'll figure this out.

-The Pentium Guy
 
Here's a copy from another messageboard I posted on:

I'm trying to find some source code samples to make up for the problems converting the code from C# to VB.net.

I export the framed animations to a single .x file using the 3rd party Lightwave D-Storm plugin.

I tried checking out Rene's sample which was said to be VB.net and DirectX 9 but I find it's only in C# and it's not working on Visual Studio 2005 for me.

I'm not looking for example using a 3rd party format, just the native DirectX .X file mesh animation format.

So does anyone know of where to find animation source code sample in VB.net for regular .x file animations?

Weither it's a simple box animation or an example of how to make Tiny.x move would be much appreciated.
 
Did you guys ever get it to work?

This is one of the main reasons they should have included VB.Net samples in the DirectX 9.0c SDK, because people wouldn't be stuck as long on these sort of problems.

But they are just too lazy to add them else they would have, but it's just too much for them to update the code because they know when they update 1 sample, they must update them all, and that's not our faults either they made so many changes to make it that way, so they expect us to just easily convert entire projects over to our native .Net languages and let me tell you it is not that simple, even when using a C# to VB.Net convertor tool, the coding styles vary from language to language a bit.

For instance, the C++ and C# DirectX coding samples rely heavily on special helper classes such as DXUtil which in most applications you will never ever use any of those, and the sight of them annoys me as it normally requires me digging through those files to sift through what's in a custom version that's not in the rest, so I can seperate it anyways to an equivalant function.

:mad:
 
Yahoo, got it, thanks Pentium Person.

So like that newSkinMeshUpdate.zip on http://robydx.altervista.org is the one you want to go for, if you've got Visual Studio 2005 you'll need to take care of some minor errors using the IDE's Error List, but once that's all taken care of you can optionally take care of the minor Warnings List bugs as well, once you do that the sample should startup just fine.

On the functions which don't return a value on all paths, simpley add return nothing at the end of the functions, and replace the animation return function with return <> code for the textures. For the bones and materials variables add = Nothing to the ends. For constant rad add As Integer, may also need to remove any unsupported form creation properties by commenting them out, after that it's all good.
 
Back
Top