Hi, I’m trying to implement scaling and rotation of a model in immersive mode.
I’ve implemented hand tracking and enabled scaling and rotation using MultiPointerScaleBehavior. The problem is, it works well in playground, but when I implement the same in the application I’m working on, it’s not working like the playground. I can able to rotate the model perfectly using pointers, but when I try to scale the model by selecting it using two pointers, the model just slips away and scales itself abnormally. I couldn’t control the scaling process. What is my problem here, and how can I fix it?
Following is the code I used.
const boundingBox = BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(mesh)
const sixDofDragBehavior = new SixDofDragBehavior()
sixDofDragBehavior.allowMultiPointer = true;
boundingBox.addBehavior(sixDofDragBehavior)
const multiPointerScaleBehavior = new BABYLON.MultiPointerScaleBehavior()
mesh.addBehavior(multiPointerScaleBehavior)