diff options
Diffstat (limited to 'src/components/ground.jsx')
-rw-r--r-- | src/components/ground.jsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/ground.jsx b/src/components/ground.jsx new file mode 100644 index 0000000..4042538 --- /dev/null +++ b/src/components/ground.jsx @@ -0,0 +1,17 @@ +import { useRef } from 'react'; +import * as everforest from '../_everforest.module.scss' +import { RigidBody } from '@react-three/rapier'; +import { DoubleSide } from 'three'; +import { useGLTF } from '@react-three/drei'; + +export default function Ground() { + const meshRef = useRef(); + const { nodes } = useGLTF('../assets/terrain.glb'); + return ( + <RigidBody type='fixed' colliders="trimesh"> + <mesh ref={meshRef} position={[0, 0, 0]} rotation={[-Math.PI / 2, 0, 0]} receiveShadow geometry={nodes.Plane.geometry}> + <meshStandardMaterial color={everforest.yellow} side={DoubleSide}/> + </mesh> + </RigidBody> + ); +} |