Ripple wird in React Three Fiber nicht angezeigt, und ich bin mir nicht sicher, warumJavaScript

Javascript-Forum
Guest
 Ripple wird in React Three Fiber nicht angezeigt, und ich bin mir nicht sicher, warum

Post by Guest »

Ich versuche, eine Welle zu erzeugen. Unten ist mein Code, der jedoch nicht auf dem Bildschirm angezeigt wird, aber ich erhalte anscheinend keine Fehler.

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
Kann mir bitte jemand helfen und mir sagen, was ich möglicherweise falsch mache?
Vielen Dank im Voraus.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post