vue-3d-model icon indicating copy to clipboard operation
vue-3d-model copied to clipboard

OrbitControls needs to reset when src changes

Open divyeshmakwana96 opened this issue 4 years ago • 3 comments

When I pan a 3D model and switch the source to another, the obit controller don't get reset. This produces a snap effect. The easy solution for me was to add this.$refs.gltf.controls.reset() onLoad event. It would be nicer if this is included in the library.

divyeshmakwana96 avatar Jul 27 '21 09:07 divyeshmakwana96

Did you solve this problem? Please

PengPeng-Qi avatar Aug 18 '22 03:08 PengPeng-Qi

I made a component that has model-gltf as a child component. I have a src property on the parent component and I have watch function which detects if the source changes. In this function I have this.$refs.gltf.controls.reset() which resets the controls. Basically, I created a parent component as a proxy.

divyeshmakwana96 avatar Aug 18 '22 03:08 divyeshmakwana96

Oh, Thanks for you answer, when i move or shrink this model, i click button want to reset model, how can i realize? i try to use this.$refs.gltf.controls.reset() but it's not work.

PengPeng-Qi avatar Aug 18 '22 05:08 PengPeng-Qi