While looking into some webGL examples (mostly Three.js based examples) I noticed large models are loaded via a combination of ASCII+binary JSON. This approach is very attractive to me because of the reduced file size.
The ASCII JSON has the general format of (taken from Three.js example, webgl_geometry_large_mesh.html) :
{
"metadata" :
{
"formatVersion" : 3,
"sourceFile" : "lucy100k.obj",
"generatedBy" : "OBJConverter",
"vertices" : 50002,
"faces" : 100000,
"normals" : 0,
"uvs" : 0,
"materials" : 0
},
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "default"
}],
"buffers": "Lucy100k_bin.bin"
}
As seen above, instead of a section containing a truck-load of vertices, normals, UVs, etc it is all packed into the referred binary file. Does anyone know how to create that binary file? Can I do it with Blender? If not, is there a script I can use?
Thanks
According to this line:
That file was generated by
OBJConverter(from some .obj and .mtl files).OBJConverteris a Python script calledconvert_obj_three.pysited inthree.js / utils / converters / obj.The own script has a comment about “How to get proper OBJ + MTL files with Blender”.