diff --git a/components/models/home/bocchi.tsx b/components/models/home/bocchi.tsx new file mode 100644 index 0000000..14ee59f --- /dev/null +++ b/components/models/home/bocchi.tsx @@ -0,0 +1,112 @@ +import { useGLTF, Float } from '@react-three/drei'; +import { useLoader } from '@react-three/fiber'; +import { JSX, useMemo } from 'react'; +import { useMediaQuery } from 'react-responsive'; +import * as THREE from 'three'; +import { DRACOLoader, GLTF, GLTFLoader } from 'three-stdlib'; + +type GLTFResult = GLTF & { + nodes: { + Object_4: THREE.Mesh; + Object_6: THREE.Mesh; + Object_8: THREE.Mesh; + Object_10: THREE.Mesh; + Object_12: THREE.Mesh; + Object_14: THREE.Mesh; + Object_16: THREE.Mesh; + }; + materials: { + main: THREE.MeshStandardMaterial; + material: THREE.MeshStandardMaterial; + yellow: THREE.MeshStandardMaterial; + blue: THREE.MeshStandardMaterial; + glass: THREE.MeshPhysicalMaterial; + }; +}; + +const BocchiRubbishBin = (props: JSX.IntrinsicElements['group']) => { + const { nodes, materials } = useLoader( + GLTFLoader, + '/models/bocchi_the_rock-processed.glb', + (loader) => { + const dracoLoader = new DRACOLoader(); + dracoLoader.setDecoderPath('/libs/draco/'); + loader.setDRACOLoader(dracoLoader); + }, + ) as unknown as GLTFResult; + + const isMobile = useMediaQuery({ query: '(max-width: 768px)' }); + const position = useMemo(() => { + if (isMobile) { + return [5, 3, 0] as const; + } + return [-12, 7, 0] as const; + }, [isMobile]); + + return ( + + + + + + + + + + + + ); +}; + +useGLTF.preload('/models/bocchi_the_rock-processed.glb'); + +export default BocchiRubbishBin; diff --git a/components/models/home/computer-desk.tsx b/components/models/home/computer-desk.tsx index d73d9f3..2c35280 100644 --- a/components/models/home/computer-desk.tsx +++ b/components/models/home/computer-desk.tsx @@ -10,6 +10,8 @@ const ComputerModel = lazy( () => import('components/models/home/computer-model'), ); const Target = lazy(() => import('components/models/home/target')); +const ReactLogo = lazy(() => import('components/models/home/react-logo')); +const Bocchi = lazy(() => import('components/models/home/bocchi')); const ComputerDesk = () => { const isMobile = useMediaQuery({ query: '(max-width: 768px)' }); @@ -32,7 +34,9 @@ const ComputerDesk = () => { rotation={[0, -Math.PI, 0]} /> + + {/* */} diff --git a/components/models/home/react-logo.tsx b/components/models/home/react-logo.tsx new file mode 100644 index 0000000..a203622 --- /dev/null +++ b/components/models/home/react-logo.tsx @@ -0,0 +1,57 @@ +import { useGLTF, Float } from '@react-three/drei'; +import { useLoader } from '@react-three/fiber'; +import { JSX, useMemo } from 'react'; +import { useMediaQuery } from 'react-responsive'; +import * as THREE from 'three'; +import { DRACOLoader, GLTF, GLTFLoader } from 'three-stdlib'; + +type GLTFResult = GLTF & { + nodes: { + ['React-Logo_Material002_0']: THREE.Mesh; + }; + materials: { + ['Material.002']: THREE.MeshStandardMaterial; + }; +}; + +export function ReactLogo(props: JSX.IntrinsicElements['group']) { + const { nodes, materials } = useLoader( + GLTFLoader, + '/models/react_logo-processed.glb', + (loader) => { + const dracoLoader = new DRACOLoader(); + dracoLoader.setDecoderPath('/libs/draco/'); + loader.setDRACOLoader(dracoLoader); + }, + ) as unknown as GLTFResult; + + const isMobile = useMediaQuery({ query: '(max-width: 768px)' }); + const position = useMemo(() => { + if (isMobile) { + return [5, 3, 0] as const; + } + return [10, 3, 0] as const; + }, [isMobile]); + + return ( + + + + + + + + ); +} + +useGLTF.preload('/models/react_logo.glb'); + +export default ReactLogo; diff --git a/public/models/bocchi_rubbish_bin-processed.glb b/public/models/bocchi_rubbish_bin-processed.glb new file mode 100644 index 0000000..1e54819 Binary files /dev/null and b/public/models/bocchi_rubbish_bin-processed.glb differ diff --git a/public/models/bocchi_the_rock-processed.glb b/public/models/bocchi_the_rock-processed.glb new file mode 100644 index 0000000..6ccb3da Binary files /dev/null and b/public/models/bocchi_the_rock-processed.glb differ diff --git a/public/models/react_logo-processed.glb b/public/models/react_logo-processed.glb new file mode 100644 index 0000000..eec88e5 Binary files /dev/null and b/public/models/react_logo-processed.glb differ