uncaught typeerror three.scene is not a constructor
时间: 2024-06-01 18:09:11 浏览: 12
这个错误通常出现在使用 Three.js 库时,可能是因为您没有正确引入 Three.js 库或者代码中存在语法错误。
请确保您已经在 HTML 文件中正确引入了 Three.js 库,并检查自己的代码中是否存在语法错误。
另外,如果您使用的是最新版本的 Three.js 库,则可能需要将代码中的 "Scene" 更改为 "THREE.Scene" 来解决这个问题。
相关问题
Uncaught TypeError: THREE.FBXLoader is not a constructor 应该怎么修改
这个错误通常是因为在使用`THREE.FBXLoader`时,THREE库没有正确加载或者版本不兼容。解决该错误的方法有两种:
1. 确认THREE库已经正确加载。可以在`<head>`标签中添加:
```html
<script src="https://cdn.jsdelivr.net/npm/three@0.132.2/build/three.min.js"></script>
```
或者使用本地的THREE库,例如:
```html
<script src="js/three.min.js"></script>
```
2. 确认THREE库的版本是否兼容。`THREE.FBXLoader`是在`three.js`库的r97版本中引入的,如果你使用的是低于该版本的THREE库,就会出现该错误。可以尝试更新THREE库或者使用其他版本兼容的FBXLoader库。
综上所述,你可以根据你的实际情况选择一种适合你的方法来解决该错误。
上面答案中 Uncaught TypeError: THREE.Geometry is not a constructor at chart:54:22
这个错误通常是因为使用了过时的THREE.js版本造成的。在新版本的THREE.js中,Geometry已经被BufferGeometry所取代。你可以将THREE.Geometry替换为THREE.BufferGeometry来解决这个问题。另外,也可以考虑升级你的THREE.js版本,以避免这个问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)