import { useRef } from 'react'; import { useFrame } from '@react-three/fiber'; import * as THREE from 'three'; interface BeaconProps { position: [number, number, number]; color?: string; height?: number; } export function Beacon({ position, color = '#22d3ee', height = 15 }: BeaconProps) { const meshRef = useRef(null); const ringRef = useRef(null); // Animate the beacon useFrame((state) => { if (meshRef.current) { // Pulse opacity const pulse = Math.sin(state.clock.elapsedTime * 3) * 0.3 + 0.5; (meshRef.current.material as THREE.MeshBasicMaterial).opacity = pulse; } if (ringRef.current) { // Expand and fade ring const t = (state.clock.elapsedTime % 2) / 2; ringRef.current.scale.set(1 + t * 3, 1, 1 + t * 3); (ringRef.current.material as THREE.MeshBasicMaterial).opacity = 0.6 * (1 - t); } }); return ( {/* Vertical Light Beam */} {/* Ground Ring */} {/* Core Glow */} ); }