"use client"; import { Canvas, useFrame } from "@react-three/fiber"; import { Float, OrbitControls, Points, PointMaterial } from "@react-three/drei"; import { useMemo, useRef } from "react"; import * as THREE from "three"; function StarsBackground() { const ref = useRef(null); const positions = useMemo(() => { const p = new Float32Array(6000); for (let i = 0; i < 6000; i += 3) { p[i] = (Math.random() - 0.5) * 60; p[i + 1] = (Math.random() - 0.5) * 60; p[i + 2] = (Math.random() - 0.5) * 60; } return p; }, []); useFrame((_, delta) => { if (ref.current) ref.current.rotation.y += delta * 0.015; }); return ( ); } function DataCore() { const coreRef = useRef(null); const orbitRef = useRef(null); const nodesRef = useRef(null); // Pre-generate node positions on a tilted orbit const nodes = useMemo(() => { const arr: { position: [number, number, number] }[] = []; const radius = 2.4; for (let i = 0; i < 14; i++) { const a = (i / 14) * Math.PI * 2; const tilt = 0.45; // slight vertical variation arr.push({ position: [Math.cos(a) * radius, Math.sin(a) * tilt, Math.sin(a) * radius] }); } return arr; }, []); useFrame((_, delta) => { if (coreRef.current) coreRef.current.rotation.y += delta * 0.15; if (orbitRef.current) orbitRef.current.rotation.y -= delta * 0.1; if (nodesRef.current) nodesRef.current.rotation.y += delta * 0.22; }); return ( {/* Central sphere */} {/* Subtle inner glow shell */} {/* Rotating analytic rings */} {[ { r: 1.75, rot: [Math.PI / 2, 0, 0] }, { r: 2.0, rot: [0.35, 0.6, 0] }, { r: 2.25, rot: [0.9, 0.2, 0.4] }, ].map((cfg, i) => ( ))} {/* Orbiting nodes */} {nodes.map((n, idx) => ( ))} ); } export default function Scene() { return (
); }