我正在尝试加载一个对象(.obj)文件以与 three.js 一起使用并做出反应(使用 react-three-renderer),但得到一个我的代码如下所示:
import React from 'react';
import ReactDOM from 'react-dom';
import React3 from 'react-three-renderer';
import TrackballControls from './TrackballControls';
import * as THREE from 'three';
import * as OBJLoader from 'three-obj-loader';
OBJLoader(THREE);
class MyClass extends React.Component {
...
render() {
...
const objLoader = new THREE.OBJLoader();
}
}
但是,我不断收到:“在'三个'中找不到导出'OBJLoader'(导入为'THREE')有人有想法吗?