I am trying to load an object (.obj) file to use with three.js and react (with react-three-renderer), yet get an
My code looks like:
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();
}
}
However, I keep on getting: "export 'OBJLoader' (imported as 'THREE') was not found in 'three'
Anyone with an idea?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…