mansa Posted August 17 Share Posted August 17 Hello, I want to render a cube with the length of an array and display it in the react canvas, but it is not possible import React, {useState} from 'react' وارد کردن { Canvas } از '@react-three/fiber' عملکرد برنامه () { const [ توله , setCub ] = useState ([ 2 , 5 , 6 , 7 ]) بازگشت ( < بوم > < ambientLight /> { توله . نقشه (( e , i ) => < mesh key = { i } > < boxGeometry /> < meshStandardMaterial color = 'hotpink' /> </ mesh > ) } </ بوم > ) } صادرات برنامه پیش فرض Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.