#
luxiaotao1123
2024-04-23 32050f795773ca0373992648a8a5b715ed2e805b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 (
        <>
            <mesh position={position}>
                <boxGeometry args={[50, 50, 50]} />
                <meshStandardMaterial color={'hotpink'} />
            </mesh>
            {/* <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;