Ripple не отображается в React Three Fiber, и я не понимаю, почемуJavascript

Форум по Javascript
Anonymous
Ripple не отображается в React Three Fiber, и я не понимаю, почему

Сообщение Anonymous »

Я пытаюсь создать пульсацию. Ниже приведен мой код, но он не отображается на экране, но ошибок, похоже, не возникает.

Код: Выделить всё

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
может кто-нибудь помочь и сказать мне, что я делаю неправильно.
Заранее спасибо.


Подробнее здесь: https://stackoverflow.com/questions/793 ... t-sure-why

Вернуться в «Javascript»