Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange error while trying to load geometry using JSONLoader()
    primarykey
    data
    text
    <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;My first Three.js app&lt;/title&gt; &lt;style&gt;canvas { width: 100%; height: 100% }&lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="https://raw.github.com/mrdoob/three.js/master/build/three.js"&gt;&lt;/script&gt; &lt;!--&lt;script src="C:/Users/danr/Desktop/ThreeJS/three.js-master/build/three.js"&gt;&lt;/script&gt;--&gt; &lt;script&gt; var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000); var renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); camera.position.z = 5; var pointLight = new THREE.PointLight(0xFFFFFF); pointLight.position.x = 2; pointLight.position.y = 5; pointLight.position.z = 10; scene.add(pointLight); loader = new THREE.JSONLoader(); loader.load( "./X738.js", function(geometry) { mesh = new THREE.Mesh(geometry, new THREE.MeshNormalMaterial()); mesh.scale.set( 1, 1, 1 ); mesh.position.y = 0; mesh.position.x = 0; scene.add(mesh); }); function render() { requestAnimationFrame(render); renderer.render(scene, camera); } render(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This is all of my code. I am using an Apache2.2 server and I used python to convert my model from an FBX to Json. Here is the error message I am getting:</p> <pre><code>THREE.WebGLRenderer 57 three.js:18058 Uncaught SyntaxError: Unexpected token , three.js:9764 xhr.onreadystatechange three.js:9764 xhr.onreadystatechange = function () { if ( xhr.readyState === xhr.DONE ) { if ( xhr.status === 200 || xhr.status === 0 ) { if ( xhr.responseText ) { var json = JSON.parse( xhr.responseText );//*Uncaught SyntaxError: Unexpected token* var result = context.parse( json, texturePath ); callback( result.geometry, result.materials ); </code></pre> <p>Any suggestions with what might be wrong??? I have tried many different solutions but nothing seems to be working and I feel very lost. </p> <p>Thanks!!!</p> <p>EDIT: Here is a sample of what the pyhton FBX to JSON converter is giving me back:</p> <pre><code>{ "metadata": { "formatVersion" : 3.2, "type" : "scene", "generatedBy" : "convert-to-threejs.py", "objects" : 1, "geometries" : 1, "materials" : 1, "textures" : 1 }, "urlBaseType": "relativeToScene", "objects" : { "Tire_Front" : { "geometry" : "Geometry_40_Tire_Front", "material" : "Material #3319", "position" : [ 0, -423.113, 451.225 ], "rotation" : [ -1.5708, 0.000987928, 6.04932e-20 ], "scale" : [ 1, 1, 1 ], "visible" : true } }, "geometries" : { "Geometry_40_Tire_Front" : { "type" : "embedded", "id" : "Embed_40_Tire_Front" } }, </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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