I am working with a local 3D object model and I load it using the following code:
const loader = new GLTFLoader();
loader.load("path/to/model", gltf => {
scene.add(gltf.scene);
});
I am trying to create a mesh out of the gltf object, but when I use the code below:
loader.load("path/to/model", (geometry, materials) => {
var mesh = new THREE.Mesh(geometry, materials);
scene.add(mesh);
mesh.position.z = -10;
});
I encounter the error message:
Cannot convert undefined to object