My Nth attempt at making animated SkinMesh work.
This time under D3D9, a lot of the work is done for us.
A lot of it, but nowhere near all of it.
Microsoft's DX9 skinmesh interfaces use a lot of "callbacks" to usercode.
This, they say, is to give greater control over various aspects of loading and rending of the mesh from a proprietary x-file format based source file.

There's a veritable mountain of dependant code even for the simple skinmesh example, and I'm diligently ploughing through it. In fact, the codebase is 95% translated, and I've begun to implement various parts of it stage by stage, debugging on the way.
Some of my recent postings in other threads relate to this work in progress.

I am not yet satisfied to post the current source, but I will, and soon.
I'm hoping some of you will help me get this working if I get stuck !!

Assuming all goes well, much of this body of work will be immediately deployed in a MultiAnimation demo, followed by a demo of a GENERIC and SMART animated character class which makes no assumptions about the animation content.
Posted on 2004-07-01 04:34:25 by Homer
I'm currently implementing the CAllocateHierarchy callback class which is required by D3DXLoadMeshHierarchyFromX.
This is a COM class which we are meant to implement in our application. Rather than doing so statically, I have instanced the interface on the Heap instead, so that we must create an instance of the class object in the usual way, and should destroy it when we are done with it.

The class definition under atc looks like this:
class CAllocateHierarchy, , COM compatible

;IUnknown methods
virtual QueryInterface
virtual AddRef
virtual Release

;CAllocateHierarchy methods
virtual CreateFrame
virtual CreateMeshContainer
virtual DestroyFrame
virtual DestroyMeshContainer
; virtual CAllocateHierarchy
; virtual $CAllocateHierarchy

I commented the constructor and destructor methods because atc will implicitly insert them, I just wanted to show where in the COM class they are inserted.

I create an instance of the class with the new() macro, and then I hand the returned instance pointer (pAlloc) to D3DXLoadMeshHierarchyFromX.

The result is that my CAllocateHierarchy_QueryInterface receives a call (from dx), which I currently don't correctly handle, but the fact that I get it means that it's ok to implement the class in the way that I have :)
Posted on 2004-07-03 03:13:17 by Homer
Weirdly, when I return S_OK from within QueryInterface, the D3DXLoadMeshFromHierarchy function quickly terminates - no calls are made to the callback loader methods in my class.
Error is 80004005 - Unspecified Error.
Posted on 2004-07-05 01:28:42 by Homer
Good news - I broke the back of the ID3DXAllocateHierarchy problem, thanks to an anonymous German programmer who was experiencing the same problem.. I don't know whether he solved it, but I did :)
The MSDN documentation for this COM class is incorrect - the class DOES NOT HAVE AN IUNKNOWN INTERFACE - its first Method is CreateFrame.
Posted on 2004-07-12 01:10:09 by Homer