feat: Sight Page update
This commit is contained in:
24
src/widgets/ModelViewer3D/index.tsx
Normal file
24
src/widgets/ModelViewer3D/index.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Stage, useGLTF } from "@react-three/drei";
|
||||
import { Canvas } from "@react-three/fiber";
|
||||
import { OrbitControls } from "@react-three/drei";
|
||||
|
||||
export const ModelViewer3D = ({
|
||||
fileUrl,
|
||||
height = "100%",
|
||||
}: {
|
||||
fileUrl: string;
|
||||
height: string;
|
||||
}) => {
|
||||
const { scene } = useGLTF(fileUrl);
|
||||
|
||||
return (
|
||||
<Canvas style={{ width: "100%", height: height }}>
|
||||
<ambientLight />
|
||||
<directionalLight />
|
||||
<Stage environment="city" intensity={0.6}>
|
||||
<primitive object={scene} />
|
||||
</Stage>
|
||||
<OrbitControls />
|
||||
</Canvas>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user