【three.js】example相关报错:three__WEBPACK_IMPORTED_MODULE_1__.OrbitControls is not a constructor“
·
需要新增第二行引入
import * as THREE from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
// 控制器
var controls = new OrbitControls(camera,renderer.domElement)
controls.addEventListener('change',()=>{
renderer.render(scene,camera)
})
更多推荐
已为社区贡献9条内容
所有评论(0)