| | |
| | | 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> */} |
| | | </> |
| | | ) |
| | | } |