const texture = useLoader(THREE.TextureLoader, 'assets/texture.png')
return (
<mesh position={[-0.00008, -0.00008, -1.26303]}>
{/*Alioth*/}
<sphereBufferGeometry
attach="geometry"
args={[1.26068]}
>
<meshStandardMaterial map={texture} attach="material"/>
</sphereBufferGeometry>
</mesh>
)
我有上面的代码,球体确实被渲染了,但没有应用纹理,当我查看我的网络选项卡时,我可以看到这个纹理被找到并正确加载。
据我所知,这是我应该按照文档执行的操作。
我也尝试过使用 @react-three/drei 辅助类,但我无法加载此纹理。
我错过了什么?