Browsing articles from "May, 2013"
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.