@TheComet
Thanks for the compliment, but I still have a lot to learn!
Quote: "How did you learn that and how long did it take?"
There's lots of info about the DirectX format on the internet. If you were to research it, for DBC, look up DirectX 7 . How long it takes to learn is relative. That depends on study habits, how fast one picks things up, how much knowledge of the subject one has already, etc. For me, I gleaned what I needed pretty fast, but what helped even before knowing the file format was learning what a face is in 3d, how the vertices relate to it, and how normals are calculated.
Direct X file format is very flexible but it also can be unforgiving if you forget any formatting details. The file format is heirarchical and references are made to templates (objects) within the heirarchy. The order of objects can be switched around but I find the following order to be the easiest to deal with and to yield the most predictable results:
// This is a comment
// The following line goes at the top of the x file
// It denotes that the type of directx file is a text file
// and that floating point values are 64 bit precision
// There is a "binary" type also, but I don't see any real
// advantage to it except if you have to load multiple models
// often. You'd gain a bit of speed because the files tend
// to be smaller (they are actually tokenized versions
// of the text format.
xof 0302txt 0064
// this could also be xof 0302txt 0032 to indicate
// 32 bit precision. A better choice for DBC
// the next lines are the header and you should treat it's
// inclusion as mandatory
Header {
1;
0;
1;
}
// most of the rest of the templates are optional but here's
// the heirarchy I prefer
// all the material definitions for all of the meshes
Material {
TextureFileName {
}
}
// Frame definitions which include all of the mesh information
// for a single object. The Frame is actually the limbs - so
// you can have frames within frames to indicate parent child
// relationships
Frame {
FrameTransformMatrix {
}
Mesh {
MeshMaterialList {
{<material name reference>}
}
MeshNormals {
}
MeshTextureCoords {
}
}
Frame {
. . .
. . .
}
}
// Animation Sets that include references to the frames
// for animation.
AnimationSet {
Animation {
AnimationKey {
}
}
Animation {
. . .
. . .
}
}
That's really all you need. The information in between are the names of the objects, numbers for vertices, face indexes etc. in the proper format. There are a lot more templates, and like your model that you attached, you can define what kind of information the templates will hold - like skin weight for example. For DBC classic, you don't need to define any templates and can use the ones (already internally defined) I laid out in the sturcture above. But feel free to experiment as you learn by adding other templates.
Enjoy your day.