简体   繁体   中英

Fault in Json object - three.js

I create a .3ds object in 3DS Max, then export in in .obj and then transform it to .js with python convert_obj_three.py -i mesh.obj -o mesh.js

There is somehting wrong with the mesh.js for sure, but I don't know what. I get this error message in chrome's console:

在此输入图像描述

在此输入图像描述

Also here is my .js file:

    / Converted from: MyBarrel.obj
//  vertices: 1097
//  faces: 1233
//  normals: 952
//  colors: 0
//  uvs: 1283
//  materials: 1
//  edges: 0
//
//  Generated with OBJ -> Three.js converter
//  http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py


var model = {

    "version" : 2,

    "scale" : 1.000000,

    "materials": [  {
    "DbgColor" : 15658734,
    "DbgIndex" : 0,
    "DbgName" : "_fueldefault",
    "colorAmbient" : [0.5843, 0.5843, 0.5843],
    "colorDiffuse" : [0.5843, 0.5843, 0.5843],
    "colorSpecular" : [0.0, 0.0, 0.0],
    "illumination" : 2,
    "opticalDensity" : 1.5,
    "specularCoef" : 10.0,
    "transparency" : 0.0
    }],

    "vertices": [16.2 .................]
    "morphTargets": [],

    "morphColors": [],

    "normals": [-0.0001,-1,-.........]
    "colors": [],

    "uvs": [[0.3286,0.22
    "faces": [43,0,1......]

    "edges" : []

};

postMessage( model );
close();

Please help!

EDIT! this should be the format of the .js file http://stemkoski.github.io/Three.js/models/android.js

I see at the top

/ Converted from: MyBarrel.obj

I assume it should be

// Converted from: ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM