-
-
Save codebucks27/6defde4db7e290d95d7ff1ae39078a06 to your computer and use it in GitHub Desktop.
This gist is for the article "Rendering a 3D model in a React JS"
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 "./App.css"; | |
import { Canvas } from "@react-three/fiber"; | |
import { Suspense } from "react"; | |
import Model from "./assets/3D-Model/Scene"; | |
import { Environment, OrbitControls } from "@react-three/drei"; | |
function App() { | |
return ( | |
<div className="App"> | |
<Canvas camera={{ fov: 18 }}> | |
<ambientLight intensity={1.25} /> | |
<Suspense fallback={null}> | |
<Model /> | |
</Suspense> | |
<Environment preset="sunset" /> | |
<OrbitControls /> | |
</Canvas> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment