Я создал компонент для загрузки и отображения сцены с 3D-моделью. Когда я пытаюсь загрузить объект GTLF, используя GLTFLoader
, я получаю сообщение об ошибке, подобное этому: сообщение об ошибке
Код загрузки GLTF-файла:
setObj = () => {
this.loader = new GLTFLoader();
this.loader.load(obj, gltf => {
this.mesh = gltf.scene;
this.mesh.children[0].material = new THREE.MeshLambertMaterial();
this.mesh.scale.set(0.5, 0.5, 0.5);
this.mesh.position.set(0, -100, 0);
this.scene.add(this.mesh);
});
}