"use client"; import { Canvas, useFrame } from "@react-three/fiber"; import { Line, OrbitControls, useTexture } from "@react-three/drei"; import { useMemo, useRef } from "react"; type RotatableGroup = { rotation: { y: number }; }; function Globe() { const groupRef = useRef(null); const cloudTexture = useTexture("/images/cloud1.png"); // Rotate the globe slowly useFrame(() => { if (groupRef.current) { groupRef.current.rotation.y += 0.002; } }); // Coordinates for markers (half-globe) const markers = [ [0, 1, 0], [0.7, 0.5, 0.2], [-0.5, 0.4, 0.5], [0.4, 0.3, -0.7], [-0.6, -0.1, 0.3], [0.3, -0.2, 0.8], ]; const arcPoints = useMemo(() => { const radius = 2.5; const verticalRadius = radius / 2; const segments = 120; return Array.from({ length: 8 }, () => { const points: number[] = []; for (let i = 0; i < segments; i++) { const t = (i / (segments - 1)) * Math.PI; const x = Math.cos(t) * radius; const z = Math.sin(t) * verticalRadius; const y = Math.sin(x / radius) * 0.5; points.push(x, y, z); } return points; }); }, []); return ( {/* Cyan arcs */} {arcPoints.map((points, i) => ( ))} {/* Cloud markers */} {markers.map(([x, y, z], i) => ( ))} ); } export function HalfGlobe() { return (
); }