I'm trying to load a model I got from 3DWarehouse into three.js. I was unable to get the Collada Loader to work, so instead I imported it into THREEJS Editor and exported it using the "export object" function. When I loaded the object into my app using the following code:
var kiss = new THREE.Object3D(), loader = new THREE.JSONLoader(true);
loader.load("model/kiss/kiss.js", function (geometry, meshKiss) {
meshKiss = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial());
kiss.addChild(meshKiss);
});
scene.add(kiss);
I got the error:
Uncaught TypeError: Cannot read property 'length' of undefined
which refers to the line in THREE.JSONLoader.prototype.parse where it asks for the first paramater's uvs length.
The object file 'geometries' has no uvs (it does have vertices, normals, and faces):
geometries: data: uvs: [[]]
I am also finding this issue when importing older JSON format files into the THREEJS Exporter (I tested the Ginger models).
Is my process valid, and if so, why is the json object not importing into THREE.JS?