如何加载我的3D对象不是来自公共文件夹?
我想知道是否有一种方法可以加载我的3D对象(.GLB)将上传到我的AWS服务器,然后我将获得端点。我尝试过,但有一个错误,说“三
。
<Suspense fallback={<div style={{color: 'white' }} className="center">loading</div>}>
<div style={{height: '100vh' }}>
<Canvas style={{background: '#000000' }} pixelRatio={[1, 2]} camera={{ position: [-2, 2, 2], fov: 40,}}>
<directionalLight position={[-5, 10, 5]} intensity={1.5} />
<ambientLight intensity={0.7} />
<spotLight intensity={0.5} angle={0.1} penumbra={1} position={[10, 15, 10]} castShadow />
<Model url="/character.glb" position-y={0.2} scale={[0.5, 0.5, 0.5]} />
<OrbitControls />
</Canvas>
</div>
</Suspense>
I would like to know if there's a way that I can load my 3d object (.glb) that will be uploaded to my AWS server then I will going to get the endpoint. I tried but there was an error saying "THREE.WebGLRenderer: Context Lost"
The file path of this is the public folder
<Suspense fallback={<div style={{color: 'white' }} className="center">loading</div>}>
<div style={{height: '100vh' }}>
<Canvas style={{background: '#000000' }} pixelRatio={[1, 2]} camera={{ position: [-2, 2, 2], fov: 40,}}>
<directionalLight position={[-5, 10, 5]} intensity={1.5} />
<ambientLight intensity={0.7} />
<spotLight intensity={0.5} angle={0.1} penumbra={1} position={[10, 15, 10]} castShadow />
<Model url="/character.glb" position-y={0.2} scale={[0.5, 0.5, 0.5]} />
<OrbitControls />
</Canvas>
</div>
</Suspense>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论