Game Development Reference
In-Depth Information
Converting FBX/Collada/3DS files to JSON
The conversion utility is placed in the code/model/convert_obj_three.py folder.
You can simply fire the following command at the terminal or the DOS window:
python convert_obj_three.py sample.fbx sample.js -t
To use this utility, you must have Python installed on your system along with FBX
Python bindings ( http://usa.autodesk.com/fbx/ ).
Also, note that the utility does not export animation data.
Loading MD5Mesh and MD5Anim files
MD5Mesh and MD5Anim are very popular 3D formats. They are lightweight and
exporters are available for all major software like Blender, Maya, and 3ds Max.
We download a utility to convert MD5 files to the JSON format using JavaScript from
http://oos.moxiecode.com/js_webgl/md5_converter/ . We also modified its
code and have added it to our code/js folder ( code/js/MD5_converter.js ). You
may simply include this file in your code and use the following sample code to load
the MD5 files:
function loadMD5() {
var meshLoaded=false;
var animLoaded=false;
var mesh="";
var anim="";
$.get("model/md5/boblampclean.md5mesh",function(data) {
meshLoaded=true;
mesh=data;
if(meshLoaded&&animLoaded) {
processMD5(mesh,anim);
}
});
$.get("model/md5/boblampclean.md5anim",function(data) {
animLoaded=true;
anim=data;
if(meshLoaded&&animLoaded) {
processMD5(mesh,anim);
}
});
}
 
Search WWH ::




Custom Search