Adding 3d objects into scene on gesture #1678
Replies: 3 comments 5 replies
-
Hello, I think you would have to share your code for an answer to that. In theory, you would add a new item to an array and |
Beta Was this translation helpful? Give feedback.
-
same as in react, view is a reflection of state: const [items, set] = useState([])
...
set(state => [...state, newItem])
...
return items.map((item, index) => <mesh key={index} {...item} />) you never add or remove children imperatively if that's what you are trying. |
Beta Was this translation helpful? Give feedback.
-
My code can be seen in the following components: ARScene component I am currently doing this strategy but not getting it to work. Does it have to do with the having to do it within the component? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to add a box into a scene every time I tap. I tried having a useState and a useCallback/useEffect that updated when the array set by state changed. However the state does not ever seem to change the array set by the state always stays empty.
is there a specific way to insert jsx 3dobjects into the canvas's dom.
Beta Was this translation helpful? Give feedback.
All reactions