feat: add render logic and orbital control for shirt model in r3f

This commit is contained in:
anshk 2026-03-17 17:38:04 +05:30
parent f845668768
commit 12ae38e9dd
2 changed files with 22 additions and 3 deletions

View File

@ -1,6 +1,17 @@
import { Suspense } from 'react';
import { Canvas } from "@react-three/fiber";
import { OrbitControls } from '@react-three/drei'
import { Model } from "./Model";
export default function App() { export default function App() {
return ( return (
<></> <Canvas camera={{ position: [0, 0, 5], fov: 45 }}>
<Suspense fallback={null}>
<Model />
</Suspense>
<ambientLight intensity={0.8} />
<directionalLight position={[3, 4, 5]} intensity={1.2} />
<OrbitControls />
</Canvas>
); );
} }

View File

@ -0,0 +1,8 @@
import { useGLTF } from '@react-three/drei'
export function Model() {
const { scene } = useGLTF('/models/ShirtBaked2.glb')
return <primitive object={scene} scale={5} position={[0, -1, 0]} />
}
useGLTF.preload('/models/ShirtBaked2.glb')