Skip to content

Instantly share code, notes, and snippets.

@codebucks27
Created September 15, 2022 09:58
Show Gist options
  • Save codebucks27/6defde4db7e290d95d7ff1ae39078a06 to your computer and use it in GitHub Desktop.
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"
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