pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.27k stars 682 forks source link

Load PivotControl at the same position #1959

Closed hegoro closed 4 months ago

hegoro commented 4 months ago

Hi there, I have a PivotControl component which I use to drag a mesh in the scene. I'm saving the mesh (mesh.toJSON()) and I can load it and maintain the same mesh position after reloading the page. But how could I do the same for the pivot control ? I mean how to save its position to reload it when refreshing the page? I have checked its position, using getPositionFromMatrix and nothing seems to work be affected getting 0,0,0 every time. I appreciate your help. Thanks

hegoro commented 4 months ago

Answering myself after multiple tests: use matrix prop, getting its value from onDrag event local parameter.