Skip to content

DirectX Models

Claude edited this page Oct 28, 2026 · 1 revision

DirectX models

LoadMesh, LoadAnimMesh and LoadAnimSeq read DirectX .x files as the original does, in all three kinds: text (xof 0303txt 0032), binary (bin , with 32 or 64 bit floats) and compressed (tzip for text and bzip for binary, in MSZip blocks). The file type is told by what is in the file, not by its name. The templates of Direct3D (Mesh, Frame, Material, AnimationSet and so on) are known, templates in the file are added to them, and objects that have no template are skipped.

  • A Frame is an entity (a mesh entity, as in the original) with the name of the frame. Its FrameTransformMatrix becomes its position, scale and rotation; a skew in the matrix is lost. A Mesh outside of any frame belongs to the entity at the top.
  • LoadMesh makes one mesh of all frames as they are before the animation, LoadAnimMesh keeps every frame as an entity.
  • A mesh has its vertices, faces (a face of more corners than three is split into a fan), normals, one set of texture coordinates and vertex colors (set on the vertices; EntityFX 2 shows them, as with any mesh). A mesh without normals gets them made. A mesh with MeshNormals or MeshTextureCoords for a different number of vertices than it has uses neither, as in the original.
  • The materials of MeshMaterialList become brushes: the face color (a color alpha of 0 counts as opaque, as in the original), and the first TextureFilename, which also makes the color white. The picture is looked for next to the model, and then in the folder of the program; folders from the machine that made the model are cut off. Triangles with the same brush share a surface.
  • The animation sets are the animation: for each Animation the keys (rotation, scale, position, in frames) are put on the frame that the animation names. The rotation is the quaternion of the file as it is, scales are made positive, matrix keys (type 4) are not used. The animation is as long as the last key. All animation sets are one animation, as in the original.
  • There are no bones: XSkinMeshHeader and SkinWeights are read but not used, so a mesh moves with its frame, as in the original.
  • LoaderMatrix "x", ... turns the vertices, normals, frames and keys of every .x file that is loaded after it.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally