blob: 2426f2a42780a6a8b083282003e144eebe4e015c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import { useRef } from 'react';
import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier';
import { useGLTF } from '@react-three/drei';
import terrainModelURL from '../assets/terrain.glb';
export default function Ground() {
const { nodes, materials } = useGLTF(terrainModelURL);
return (
<RigidBody type='fixed' colliders="trimesh">
<mesh position={[0, 0, 0]} geometry={nodes.ground.geometry} name='ground'>
<meshStandardMaterial color={everforest.yellow}/>
</mesh>
<mesh geometry={nodes.pyramid.geometry} name='ground'>
<meshStandardMaterial color={everforest.bg2}/>
</mesh>
</RigidBody>
);
}
|