import { useMemo } from 'react';
|
import { useGLTF } from '@react-three/drei';
|
import * as THREE from 'three';
|
import { MODEL_SHELF_SCALE } from '@/config/setting'
|
|
const Shelf = (props) => {
|
const { position = [0, 300, 0], rotationY = 0 } = props;
|
|
const { scene } = useGLTF('/models/shelf/row.glb');
|
console.log(scene);
|
|
const model = useMemo(() => scene.clone(), [scene]);
|
|
return (
|
<>
|
<group rotation-y={rotationY} position={position}>
|
<primitive
|
object={model}
|
castShadow
|
receiveShadow
|
scale={[MODEL_SHELF_SCALE, MODEL_SHELF_SCALE, MODEL_SHELF_SCALE]}
|
/>
|
</group>
|
</>
|
)
|
}
|
|
export default Shelf;
|