Encountering difficulties while trying to load a 3D object into Three.JS on my website. The 3D images were created in Blender and then exported to .JSON format using MrDoobs exporter addon.
edit: This is the exporter I am utilizing - https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender
var loader = new THREE.JSONLoader();
loader.load('cube.json', function (loadedGeometry) {
var loadedMaterial = new THREE.MeshNormalMaterial({color: 0x55B663});
var loadedMesh = new THREE.Mesh(loadedGeometry, loadedMaterial);
loadedMesh.position.set(-0.8,1,9);
scene.add(loadedMesh);
});
This code works fine for me.
However, when I simply change 'cube.json' to 'tree.json' strange errors occur.
In Google Chrome, I see:
"three.min.js:387 Uncaught TypeError: Cannot read property 'length' of undefined"
In Firefox Firebug, I observe:
TypeError: p is undefined
...;d<D;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p...
three.min.js (line 387, col 221)
Contents of cube.JSON:
// JSON data here
A basic cube from Blender can be viewed at this image: https://i.sstatic.net/4R27J.png
Data for tree.JSON:
// JSON data here
An image of the tree in Blender: https://i.sstatic.net/yPlP2.png
Link to tree.blend file - mega.nz/#!U9UTxYYZ!-0X13Ur2E2d96BTbOVhhEBb1AiaV8g6r988XoTTV6XY
Any insights or suggestions would be greatly appreciated!