"use client"; import { Canvas, useFrame } from "@react-three/fiber"; import { useRef, useMemo } from "react"; import * as THREE from "three"; import { Float, PerspectiveCamera } from "@react-three/drei"; function DNAParticles() { const points = useMemo(() => { const p = []; const count = 100; const radius = 2; const height = 15; for (let i = 0; i < count; i++) { const angle = (i / count) * Math.PI * 4; const x = Math.cos(angle) * radius; const y = (i / count) * height - height / 2; const z = Math.sin(angle) * radius; // Strand 1 p.push(new THREE.Vector3(x, y, z)); // Strand 2 (180 deg offset) p.push(new THREE.Vector3(-x, y, -z)); // Connecting rungs if (i % 5 === 0) { const rungPoints = 5; for (let j = 1; j < rungPoints; j++) { const t = j / rungPoints; p.push(new THREE.Vector3( x * (1 - 2 * t), y, z * (1 - 2 * t) )); } } } return p; }, []); const groupRef = useRef(null); useFrame((state) => { if (groupRef.current) { groupRef.current.rotation.y += 0.005; groupRef.current.rotation.z = Math.sin(state.clock.elapsedTime * 0.5) * 0.1; } }); return ( {points.map((pos, i) => ( ))} ); } export default function DNAHeroBackground() { return (
); }