Ripple wird in React Three Fiber nicht angezeigt, und ich bin mir nicht sicher, warum
Posted: 14 Jan 2025, 09:31
Ich versuche, eine Welle zu erzeugen. Unten ist mein Code, der jedoch nicht auf dem Bildschirm angezeigt wird, aber ich erhalte anscheinend keine Fehler.
Kann mir bitte jemand helfen und mir sagen, was ich möglicherweise falsch mache?
Vielen Dank im Voraus.
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.