Game Development Reference
In-Depth Information
Use exported files from Blender, objectname.obj and objectname.mtl , in the
following command.
If you are using a Mac, open Terminal, or if you are using Windows, open Command
Prompt and enter the following command:
python convert_obj_three.py -i objectname.obj -o objectname.json
The JSON file
Open the Cube.json file from the model folder in your favorite text editor.
The following code is of the Cube.json file:
{
"metadata" :
{
"formatVersion" : 3.1,
"sourceFile" : "Cube.obj",
"generatedBy" : "OBJConverter",
"vertices" : 8,
"faces" : 12,
"normals" : 0,
"colors" : 0,
"uvs" : 0,
"materials" : 1
},
"scale" : 1.000000,
"materials": [{
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" :"",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.80000000000000004, 0.80000000000000004,
0.80000000000000004],
"colorSpecular" : [0.80000000000000004, 0.80000000000000004,
0.80000000000000004],
"illumination" : 2,
"specularCoef" : 0.0,
"transparency" : 1.0
}],
"vertices": [-0.446862,0.067651,0.815504,........],
"morphTargets": [],
"morphColors": [],
"normals": [],
"colors": [],
"uvs": [[]],
 
Search WWH ::




Custom Search