我很确定我的 JavaScript 代码中有使用 Three.js OrbitControls 所需的一切。我有:
<script>"OrbitControls.js"></script>
并且:
var cameraControls;
cameraControls = new THREE.OrbitControls(camera, renderer.domElement);
它没有抱怨。但我的错误说...
未捕获的类型错误:无法在 public_html/OrbitControls.js:76 读取未定义的属性“LEFT”(21:20:28:855 | 错误,javascript)
它指的是 OrbitControls 文档,其中说:
this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };
我不知道如何解决它,任何东西都会非常感激!