在三 - drei中的SA模型时,环境可能不会呈现
那就是我如何渲染我的环境的
const Three = () => {
return (
<>
<PerspectiveCamera makeDefault position={[0,3,10]} />
<OrbitControls />
<directionalLight args={[0xffffff, .5]} position={[-5,20,0]} castShadow />
<spotLight args={[0xffffff]} position={[0,10,0]} castShadow />
<Model scale={0.5} />
<Environment background>
<mesh scale={100}>
<sphereGeometry args={[1, 64, 64]} />
<meshBasicMaterial side={THREE.BackSide} />
</mesh>
</Environment>
</>
)
}
export default Three
。
function App() {
return (
<div>
<Canvas
style={{height:'100vh',backgroundColor:'transparent'}}
shadows
>
<Three />
</Canvas>
</div>
)
}
export default App
PS:删除模型时,环境正常 我尝试使用不同的压缩,不同的模型仍然存在相同的问题,有人知道是什么原因引起了问题吗?
thats how i render my environment
const Three = () => {
return (
<>
<PerspectiveCamera makeDefault position={[0,3,10]} />
<OrbitControls />
<directionalLight args={[0xffffff, .5]} position={[-5,20,0]} castShadow />
<spotLight args={[0xffffff]} position={[0,10,0]} castShadow />
<Model scale={0.5} />
<Environment background>
<mesh scale={100}>
<sphereGeometry args={[1, 64, 64]} />
<meshBasicMaterial side={THREE.BackSide} />
</mesh>
</Environment>
</>
)
}
export default Three
thats my app.js
function App() {
return (
<div>
<Canvas
style={{height:'100vh',backgroundColor:'transparent'}}
shadows
>
<Three />
</Canvas>
</div>
)
}
export default App
the output after changing a state or normal refresh when saving in vite
ps : the environment works fine when i remove the model
i tried to use different compression , different models i still have the same issue do anyone know what is causing the issue ?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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