   Working with the DirectX .X File Format and Animation in DirectX 9.0
  Comments for the article Working with the DirectX .X File Format and Animation in DirectX 9.0
  Hey Jason,nice article Just 1 quick question though...(Copied from my previous post about it)Is there a certain way in creating animation-set''s in a packagelike 3D Studio Max,for the .X Format,or does the direct x exporter(depending on which one)handle seperating them automatically.E.G,you have a character in 3DStudio that has 130 frames of animation.0-29 has an idle anim,30-59 has a walk...run etc.How do you actually seperate them,into something like set1: idleset2: walk set3: run set4:die etc etc??Is it animation package specific or DirectX exporter specific?    DirectXXX   Member since: 9/24/2002   From: Pakistan  Posted - 1 April 2004 10:37:13 AM  directx supports animation set if you are a programmer you have to modify example exporter of max to save .x animation sets. But if you are not a programmer just save individual .x files of each set and use MeshView utility that comes with DXSDK to combine them into 1 .x file.dirtbag   Member since: 3/30/2004   From:  Posted - 1 April 2004 11:16:33 AM  What i really want to have is several anim sets in only 1 file.Btw,i''m a programmerIv''e actually just read the new article on the .X format(here on the news page).If i''m unsuccessful in this thread,i''ll post there.So,i gather the (easiest)solution would be to say..animate an idle animation,then export to .x format.Animate my other sets,exporting as seperate files.Then finally,open then up,and copy and paste the sets from all the differnt files,into 1 .xfile.Yes? No?    dirtbag   Member since: 3/30/2004   From:  Posted - 1 April 2004 11:26:44 AM  One more thing..Iv''e opened an .xfile with notepad.which sections need to be copy + pasted to the 1 file?The section at the bottom after:}and at the start of the word..AnimationSet{etc...etc..}end of the file? Appreciate your help jason.;  If you look within an X file that has animations (e.g tiny.x) you''ll see that there are templates called "AnimationSet" amongst all the others. They take the form ofAnimationSet {  .  .  Data and sub-templates etc  .  .}An "AnimationSet" encapsulates any one animation. There are typically many "Animation" templates within an "AnimationSet" - as many "Animation" templates as there are bones in your model. If you export to text format you can easily give the single animation a name like thisAnimationSet WalkAnim {  .  .  Data and sub-templates etc  .  .}which you can reference in your game engine (or see in the MeshView utility). So essentially and to answer you question, you can export your animations from MAX one at a time in to individual X files. With the model being the same you can just copy the entire AnimationSet templates from each X file and paste them one after the other in a single file. Just give each AnimationSet a unique name.;  Sorry about the late reply.the exporter that I used just used the Maya time scale to deside what is an animation set.If I wanted to put multiple animations into one model I would have to export out the seperate animation data and then copy/paste it into the model.I know this is kinda getto but I did not write the exporter. the models that I used in the article are included in the MS SDK examples if you would like to take a look at them.I hope this answers your question. if not feel free to email me.   ___________________________Jason Jureckawww.jurecka.usjason@jurecka.uswww.tsbgames.com"Everything is a game."   [edited by - jasonjurecka on April 4, 2004 5:42:59 AM];  Hi JasonThanks for a great article...!I''ve implemented the code into my own project, but if I use lighting the model is all black!?Do you have any idea what to do?Best regardsRoquqkiemikkel.hempel@tele2adsl.dk ;  You can load models with different animation sets into the MeshView utility (comes with SDK) and combine them together into one .x file ;  it is good to hear people are using it.The model is black because the model does not have vert normals. there is an DX9 SDK example which goes through adding them in. I dont remember off hand which one it was but i do remember that the test app had a skull for the .x file that was used. If you have the sdk look at the sample browser. ___________________________Jason Jureckawww.jurecka.usjason@jurecka.uswww.tsbgames.com"Everything is a game."   [edited by - jasonjurecka on April 6, 2004 5:15:24 PM];  Hi JasonYes I kindda figured that out, so I computed its normals using the DX Mesh viewer, which is included in the SDK-tools.In the mesh-viewer I can see it with lighting...But! It's still black! :|Best regardsRoquqkie   [edited by - Roquqkie on April 7, 2004 8:45:05 AM];  Ok well check and make sure you have the texture in the right directory.In the tutorial the texture that is used is assumed to be local to the location of the .x file. ___________________________Jason Jureckawww.jurecka.usjason@jurecka.uswww.tsbgames.com"Everything is a game." ;  The texture is working... When I turn off lighting I can see the texture...Best regardsRoquqkie 