Note that there are some explanatory texts on larger screens.

plurals
  1. POTHREE.JSONLoader Error in Chrome
    text
    copied!<p>I converted a model. Obj to. Js</p> <p>When I try to load the. Js with THREE.JSONLoader like this:</p> <pre class="lang-js prettyprint-override"><code>var loader = new THREE.JSONLoader(); loader.load( {model: "/modelos/modelos3D/Dragon.js", callback: agregarDragon } ); function agregarDragon( geometria ) { geometria.materials[0][0].shading = THREE.FlatShading; geometria.materials[0][0].morphTargets = true; var material = new THREE.MeshFaceMaterial(); modeloDragon = new THREE.Mesh( geometria, material ); modeloDragon.scale.set(50,50,50); escena.add( modeloDragon ); } </code></pre> <p>some Dragon.js:</p> <pre class="lang-js prettyprint-override"><code>{ "metadata" : { "formatVersion" : 3, "sourceFile" : "Dragon.obj", "generatedBy" : "OBJConverter", "vertices" : 3143, "faces" : 11130, "normals" : 10066, "colors" : 0, "uvs" : 1172, "materials" : 3 }, "scale" : 1.000000, "materials": [ { "DbgColor" : 15658734, "DbgIndex" : 0, "DbgName" : "Material__35" }, { "DbgColor" : 15597568, "DbgIndex" : 1, "DbgName" : "Material__47" }, { "DbgColor" : 60928, "DbgIndex" : 2, "DbgName" : "Material__83" }], "vertices": [-0.696100,0.260000,0.408700,....] . . } </code></pre> <p>when I try to load with chrome generates the following error</p> <pre class="lang-none prettyprint-override"><code> Uncaught SyntaxError: Unexpected token : </code></pre> <p>and emphasizes the line</p> <pre class="lang-js prettyprint-override"><code>"metadata" : </code></pre> <p>and Minefield with firebug:</p> <pre class="lang-none prettyprint-override"><code> invalid label: Dragon.js(line 3, col 4 ) "metadata" : </code></pre> <p>why this error is generated?</p> <p>how to fix?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload