arkit_flutter_plugin icon indicating copy to clipboard operation
arkit_flutter_plugin copied to clipboard

zoom and rotate bug

Open maxTeste opened this issue 4 years ago • 3 comments

hi, the zoom and rotate features work, but there's a bug. each time you zoom or rotate the object it resets to the default position. is there any way to improve these two features and not always reset to size and starting position?

maxTeste avatar Jun 09 '21 14:06 maxTeste

For me the scale and rotation work independently, but after applying a rotation the scale then will scale into ridiculous high values and eventually crash the app. This also happens with the Manipulation example provided. Do you encounter the same issue with your object @maxTeste? And if not, might you share how you rotate and scale the object?

I see that the scale setter on an ARKitNode somehow takes the rotation into account, I am sadly no expert on these things and I am wondering, if that is causing my issue of the scaling suddenly getting extrem values when combined with rotation.

set scale(Vector3 value) { transform = Matrix4.compose(position, Quaternion.fromRotation(rotation), value); }

NicolasDurant avatar Aug 08 '21 23:08 NicolasDurant

There is an hacky workaround for this bug. Bypass the broken scale and rotate functions of the plugin by removing the object from the SceneView and placing a complete new one (with new sizes and rotation) at every gesture handler call. It is definitely not ideal, but for lightweight renders it's unnoticeable for the user and easy to implement.

frarcos avatar Jul 29 '22 21:07 frarcos