Hi there, I am working on implementing a simple TheeJS code that will allow me to load some 3D js files using JSONLoader. These 3D files were exported from Blender exporter, but when I run this part of the code, I encounter two errors:
Uncaught TypeError: Cannot read property 'map' of undefined
Uncaught TypeError: Cannot read property 'attributes' of undefined
Here is a snippet of my code where I attempt to load the JSON 3D file:
var load = function ( file, callback )
{
var loader = new THREE.JSONLoader();
loader.load( file, function( geometry, materials ){
callback( new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) ) );
});
}
load("models/porsche.js", function(car){
car.position.set( 0, 0, -2 );
car.rotation.y = Math.PI / -2;
scene.add(car);
});
Furthermore, when I use other types of Materials like Phong or Lambert, it works perfectly fine. However, these errors only occur when I use MeshFaceMaterial. Any suggestions on what I should do?