My goal is to utilize Three.js (OGL + JavaScript) to load an object from a file. I have a functional example that renders some basic elements, but when attempting to load an object using JSONLoader.load(...)
, Firefox's console displays an error:
SyntaxError: missing formal parameter
You can find more information in the documentation here:
Below is the source code snippet of my attempt to load the object which is causing the error:
//loading an object
var loader = new THREE.JSONLoader(); //this part works
loader.load("./Project2/proj/grzyb.js",
function(geometry,
new THREE.MeshLambertMaterial( { map: texture, ambient: 0xbbbbbb } )
//the line above triggers a "SyntaxError: missing formal parameter" message in Firefox console
){
var materials = new THREE.MeshFaceMaterial(
new THREE.MeshLambertMaterial( { map: texture, ambient: 0xbbbbbb } )
);
grzyb = new THREE.Mesh(geometry, materials);
grzyb.scale.set(5, 5, 5);
grzyb.position.set(2,2,2);
grzyb.receiveShadow = true;
grzyb.castShadow = true;
scene.add(grzyb);
}
);