Code: Select all
import './App.css';
import { useMemo } from 'react';
import * as THREE from 'three';
import { Canvas, useLoader} from '@react-three/fiber';
import circleImg from './assets/circle.png';
import { Suspense } from 'react';
function Points(){
const imgTex = useLoader(THREE.TextureLoader, circleImg);
const count = 500;
const sep = 3;
const positions = useMemo(() => {
let coords = [];
for(let i = 0; i < count; i++){
for(let j = 0; j < count; j++){
let x = sep * (i - count/2);
let z = sep * (j - count/2);
let y = 0;
coords.push(x,y,z);
}
}
let arr = new Float32Array(coords);
console.log(arr);
return arr;
}, [count, sep]);
return(
)
}
function AnimationCanvas(){
return (
)
}
function App() {
return (
)
}
export default App
Vielen Dank im Voraus.