Replies: 2 comments 1 reply
-
you do it in the same way that you would do it in threejs, or in that video. dont break your head about the declarative stuff, this is only there to assist you, not to create limitations. create your buffergeom in a useMemo or useState. const foo = useMemo(() => new THREE.Foo(...........), [conditions])
return <mesh geometry={foo} /> |
Beta Was this translation helpful? Give feedback.
1 reply
-
here's an example where you create the attribute declaratively https://codesandbox.io/s/r3f-instanced-colors-8fo01 but again, you dont have to. you make it declarative when you need it to be managed, auto disposal, events, props, etc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Noob here,
I am trying to follow this simple tutorial: https://youtu.be/uD4GnMsAH1U but recreate it using react-three-fiber and for some reason I cannot wrap my head around the buffer attribute part of the video.
from what I can tell It seems I need to be able to create a bufferAttribute array that is the same length is the number of vertices in my geometry but I don't know how to get that information in the react-three-fiber way...
is this what useUpdate is for?
any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions