有人尝试过在ReactJS
中使用OrbitControls
函数吗?
这是我编写的示例代码:
import React, { Component } from 'react';
import 'tachyons';
import * as THREE from 'react';
import OrbitControls from 'three-orbitcontrols';
class App extends Component {
render() {
...
//Controls
const controls = new OrbitControls(camera, renderer.domElement)
controls.dampingFactor = 0.25
controls.enableZoom = false
它返回以下错误:
./node_modules/three-orbitcontrols/OrbitControls.js 1054:70-89 "export 'OrbitControls' (imported as 'THREE') was not found in 'three'
有谁知道如何解决这个问题吗?
import * as THREE from 'react';
- Mugen87