【发布时间】:2020-11-17 16:40:23
【问题描述】:
所以我探索了多种关于在我的网络应用程序中渲染搅拌机模型的选项,现在我将我的模型导出为.gltf 格式,这是我的代码
App.js
import React, { Suspense } from 'react';
import './App.css';
import Model from './Model'
function App() {
return (
<div className="App">
<Suspense fallback={null}>
<Model />
</Suspense>
</div>
);
}
export default App;
Model.js
import React from 'react'
import { useLoader } from 'react-three-fiber'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
import Scene from './scene.gltf'
function Model(props) {
const { nodes, materials } = useLoader(GLTFLoader, Scene)
return (
<div>
</div>
)
}
export default Model
问题
GLTF 加载器抛出错误
我想要什么
- 我想渲染我的模型,因为它在反应应用程序的搅拌器中显示为 尽我所能
- 旋转控件会很棒..
抛出错误
RangeError: Invalid typed array length: 1299
at new Float32Array (<anonymous>)
at GLTFLoader.js:1965
at async Promise.all (:3000/index 0)
at async Promise.all (:3000/index 0)
at async Promise.all (:3000/index 4)
at async Promise.all (:3000/index 0)
at async Promise.all (:3000/index 2)
at async Promise.all (:3000/index 0)
at async Promise.all
【问题讨论】:
标签: javascript reactjs three.js blender react-three-fiber