Open
Description
import { Canvas } from '@react-three/fiber'
import { Physics, RigidBody, HeightfieldCollider } from '@react-three/rapier'
export default function App() {
return (
<mesh position={[0, 2, 0]}>
<boxGeometry args={[1, 1, 1]} />
)
}
function TestHeightfield() {
// 2x2 grid => you need exactly 4 height values
const heights = [0, 1, 1, 0];
return (
<HeightfieldCollider
args={[2, 2, heights, { x: 1, y: 1, z: 1 }]}
/>
);
}

Metadata
Metadata
Assignees
Labels
No labels