Last active
February 6, 2022 08:17
-
-
Save PabloAlexandre/f56ac36b2405e7c3b022502fd512d9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Canvas } from '@react-three/fiber'; | |
import { useTexture } from '@react-three/drei'; | |
import { DoubleSide, Vector3 } from 'three'; | |
import image from './panorama.jpg'; | |
import { Suspense } from 'react'; | |
const Scene = () => { | |
const texture = useTexture(image); | |
return ( | |
<mesh scale={new Vector3(-1, 1, 1)}> | |
<sphereBufferGeometry args={[500, 60, 40]} /> | |
<meshBasicMaterial map={texture} side={DoubleSide} /> | |
</mesh> | |
); | |
} | |
function App() { | |
return ( | |
<div style={{ width: '100vW', height: '100vH', background: '#723983' }}> | |
<Canvas camera={{ | |
near: 1, | |
far: 1100, | |
aspect: 16 / 9, | |
fov: 70 | |
}}> | |
<Suspense fallback={null}> | |
<Scene /> | |
</Suspense> | |
</Canvas> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment