May 16, 2013

Md5 to json converter


Here’s a tool to convert *.md5mesh and *.md5anim files to the json format(3.1) used by three.js. The MD5 format is from id Tech 4(Doom 3, Quake 4, Wolfenstein and more).

It’s skeletal animation(skinning), the earlier MD2 format for example is vertex animation(morphTargets).

Here’s how you use it:
1. Drag and drop a *.md5mesh file.
2. Drag and drop a *.md5anim file.
3. Drag and drop a jpg/png for texture.
Any image containing ‘normal’ will be used as a normalMap, ‘bump’ as bumpMap, ‘specular’ as specularMap. None of these and it will be used as the diffuseMap. (this is for preview only and is not saved in the json)

Then save the file.

You can also tick “Lock rootbone” this locks the root bone to position 0,0,0 and the rotation to 0,0,0.
There is also an option to only export the animation data.

Also posted a fairly simple example of how to load a model and some animations, see here. Also shows how you could position other objects relative to the bones.

A small note about materials. I made it so every “mesh” in the *.md5mesh gets it’s own material index. And the idea is that you override the materials in the json-file with your own materials. The above example does that for example.

Three.js does currently not support blending of animations(like interpolating between animations for smooth transitions), hopefully someone will add that sometime in the future. Would be a great feature to have. :)
Edit (Feb 13 2014): Someone added basic support for blending a few months ago to three.js. Did a first test here, using the troll from the Hobbit-project.


  • Hey there! I am wondering what the licensing is for the MD5 converter code… I would love to be able to play with this for my own projects.

  • This is a wonderful project. I played with it, but experienced some serious bugs.
    Many meshes do not load or have errors in it. The animations are buggy too.
    A model does have various textures defined the .md5mesh file. However, I think, this viewer does only support single textured models. Every time I get just a gray looking model. Additionally, in the doom3 game the texture naming convention is with a underscore _s, _h, _n, _local

    There is a C++ library with a guide to the exact md5 model specification Maybe it helps to fix the problems.

    • Any specific files you had problems with? Available anywhere? I have only tried some from Doom 3 and Quake 4 and some that 3d artists have exported from 3dsmax, and they seemed to work ok. Yes the viewer/converter only supports one material, but you can easily override that as you can see in the Hellknight example, which have 4 materials/textures.

Leave a comment