#
luxiaotao1123
2024-04-23 32050f795773ca0373992648a8a5b715ed2e805b
src/components/shelf.jsx
@@ -9,20 +9,22 @@
    const { scene } = useGLTF('/models/shelf/row.glb');
    console.log(scene);
    // 在useMemo内部克隆模型,以避免影响到原始模型
    const model = useMemo(() => scene.clone(), [scene]);
    return (
        <>
            <group rotation-y={rotationY} position={position}>
                {/* 在primitives内设置模型的比例和阴影属性 */}
            <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>
            </group> */}
        </>
    )
}