threejs调用报错 XMLHttpRequest is not a constructor?
载入使用https://github.com/yannliao/threejs.miniprogram依赖构造threejs项目的时候,尝试导入外部模型失败,可以使用创建的正方体完成相关操作。 import * as THREE from '../../miniprogramThree/test1/threejs/three.weapp.min'
import { OrbitControls } from '../../miniprogramThree/test1/controls/OrbitControls'
import {GLTFLoader} from '../../miniprogramThree/test1/loaders//GLTFLoader';
..............
const loader = new GLTFLoader();
loader.load('https://threejs.org/examples/models/gltf/RobotExpressive/RobotExpressive.glb', function (gltf) {
model = gltf.scene;
scene.add(model);
}, undefined, function (e) {
console.error(e);
});
报错 [图片] 有可能是threejs版本不兼容的问题,但是我用的同一个资源包下的依赖