Replies: 2 comments
-
https://r3f.docs.pmnd.rs/advanced/pitfalls there are many suggestions here. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Using forward ref here npx gltfjsx -t ./public/robot.gltf Then modify the line to
And find the line
and then add ref={bones}
Make a new tsx file named RandomControlledRobot.tsx
|
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
-
I am a newbie here. I am working on a machine tool model for a week, I have made it in blender and import to my project by gltfjsx. Also together I have a controller which read data from backend, it's action data, such as rotate left leg bone at speed 5. I use those data to drive my model to make animation.
For simple I used robot model as example here.
https://threejs.org/examples/#webgl_animation_skinning_morph
After gltfjsx parsed, I insert
It works but I found the whole Robot component re-render every 1 second(same as the interval that controller updates the action). In my real project the data change more frequently so I do not want re-render the model. I have changed
const actionGetter = useControls();
and made my controller return a getter function but it did not prevent the re-render.I have also tried leva useControls yet but nothing good.
So my question is: what's the best practice to drive the model by controller and don't re-render the heavy model when the data changes?
Beta Was this translation helpful? Give feedback.
All reactions