Dumber question on character animation

Started by
8 comments, last by SoaringTortoise 20 years, 11 months ago
Just to make sure I got this right: DX8 has no native functions for loading a frame-hierarchy, allowing you to render a particular animation frame by, for example, just saying Mesh.Render(Frame). So I have to write my own file-loader and my own frame sequencer using the DirectXFile objects. Right? This is a trivial task, but I just want to make sure I''m not off on a needless mission (and don''t tell me about that d3dFrame/d3danimation stuff... it''s unusable for my project). (I''m already using multiple .x files for animation, so the hermite spline animation side is fine, just the loading from a single mesh... which I finally managed to get working in 3dmax). Last thing to go through a tortoise''s mind before it hits the ground at 40mph? "D3DXVec3Add (Tortoise.Pos, Tortoise.Delta, Tortoise.OldPos"
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
Advertisement
D3DX has some basic support for hierarchies (the emphasis is on basic though).

It requires you to implement a couple of interfaces, and other bits and bobs. If you''re interested I can explain the details.

Try these things in the docs..

D3DXLoadMeshHierarchyFromX
LPD3DXALLOCATEHIERARCHY
LPD3DXFRAME

Sorry treething, that''s all DX9 stuff :-(

Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
It wouldn''t be that hard to write a loader would it?
You just apply the matrices of that frame, and render it, right?
It should be even simpler, since you don''t need to use smooth animation(timebased).

.lick
Nope. Not difficult. Done it already. Just didn''t want to write a loader if there was one already in DX8 and I just couldn''t find it.
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
Sorry SoaringTortoise I would not want to ruin your topic, but I''m very interested to the treething''s explanation about D3DXLoadMeshHierarchyFromX
LPD3DXALLOCATEHIERARCHY
LPD3DXFRAME

Can you explain the details please?

thanks =)
Hi. You can use D3DXLoadMeshHierarchyFromX to load a frame hierarchy from a .x file into memory. If you look at the function in the SDK docs you''ll see that it uses the ID3DXAllocateHierarchy interface. You need to create a class that inherits from this interface and implements its methods (CreateFrame, CreateMeshContainer, etc). You then pass an instance of this class into the D3DXLoadMeshHierarchyFromX function when you call it.

You can ignore the LPD3DXLOADUSERDATA and LPD3DXANIMATIONCONTROLLER interfaces for now.

The D3DXLoadMeshHierarchyFromX function scans through the .x file. Each time it finds a frame it calls the CreateFrame method that you implemented. In this function you can create the frame in whatever way you like. You can just create a D3DXFRAME object, copy the parameters, and pass it back.

In my current engine I have a scene-graph. The frame class in the scene-graph is derived from D3DXFRAME, and I create these in the CreateFrame function.

Similarly, in the CreateMeshContainer function you can create your mesh objects (derived from D3DXMESHCONTAINER), and do any post-processing that they need.

The end result of the function call should be a complete frame/mesh hierarchy, in your engines format. Very useful for things like skinned meshes, because the bones are just frames.

In my engine after the call to D3DXLoadMeshHierarchyFromX I do a pass over the new frame hierarchy to fix a few things (like parent frame pointers).

All of this is in the docs and SDK samples, though you may have to dig a little for it.

HTH,
Chris
Ok... Thank you Treething... I''ll try to do it.

In SDK samples, I''ve found only D3DXLoadMeshHierarchy... and with google the string "D3DXLoadMeshHierarchyFromX tuuorial" return only 2 webpage... =)

between few days, I''ll come back with new questions.. ^__^

I''m a newbie ... can I use an animate mesh?
I''ve read SDK,but it is too many difficult for me

I want do only pacman clone, but with static mesh it''s orribleeeee....

Can anyone help me? there is some easy tutorials?

help me pleaseeeeee

yes I''m a kick ass.... but ... I love the videogames and I would do a pacman clone....

This topic is closed to new replies.

Advertisement