import { Canvas, useFrame } from '@react-three/fiber';
import { Points, PointMaterial } from '@react-three/drei';
import { useRef, useMemo } from 'react';
import * as THREE from 'three';
function NeuralMesh(props) {
const ref = useRef();
const [sphere] = useState(() => new Float32Array(2000 * 3));
// Generate random points in a spherical distribution
useMemo(() => {
for (let i = 0; i < 2000; i++) {
const r = 1.5 * Math.cbrt(Math.random());
const theta = Math.random() * 2 * Math.PI;
const phi = Math.acos(2 * Math.random() - 1);
const x = r * Math.sin(phi) * Math.cos(theta);
const y = r * Math.sin(phi) * Math.sin(theta);
const z = r * Math.cos(phi);
sphere[i * 3] = x;
sphere[i * 3 + 1] = y;
sphere[i * 3 + 2] = z;
}
}, [sphere]);
useFrame((state, delta) => {
ref.current.rotation.x -= delta / 10;
ref.current.rotation.y -= delta / 15;
});
return (