A neon wireframe floor grid with ridges rolling toward a distant horizon.
three @react-three/fiber @react-three/drei<WaveHorizon /> inside your own <Canvas>.import { useRef } from 'react';
import { useFrame } from '@react-three/fiber';
import type { Mesh, BufferAttribute } from 'three';
export default function WaveHorizon({ color = '#ff2fd0', scale = 1 }: { color?: string; scale?: number }) {
const ref = useRef<Mesh>(null);
useFrame((state) => {
const mesh = ref.current;
if (!mesh) return;
const t = state.clock.elapsedTime;
const pos = mesh.geometry.attributes.position as BufferAttribute;
for (let i = 0; i < pos.count; i++) {
const x = pos.getX(i);
const y = pos.getY(i);
// ridges travelling toward the viewer along the depth axis
pos.setZ(i, Math.sin(x * 1.1 + t) * 0.14 + Math.sin(y * 2.0 - t * 1.6) * 0.26);
}
pos.needsUpdate = true;
});
return (
<mesh ref={ref} rotation={[-1.15, 0, 0]} position={[0, -0.7, 0]} scale={scale}>
<planeGeometry args={[7, 7, 48, 48]} />
<meshBasicMaterial color={color} wireframe toneMapped={false} />
</mesh>
);
}