Skip to content

Instantly share code, notes, and snippets.

@PabloAlexandre
Last active February 6, 2022 08:17
Show Gist options
  • Save PabloAlexandre/f56ac36b2405e7c3b022502fd512d9e4 to your computer and use it in GitHub Desktop.
Save PabloAlexandre/f56ac36b2405e7c3b022502fd512d9e4 to your computer and use it in GitHub Desktop.
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