Hey, I am trying to use babylonjs for my project. I can’t implement smooth mesh rotation.
I need to animate picking the model up from the shelf and bring in front of camera, that works . And then I want to rotate picked model just like I hold it with my hand, similar to what arcRotate camera does. But the rotation I get is not smooth and doesn’t look real.
I tried to create the model rotation using event listeners - pointerdown, pointermove, pointerup - found the logic from this (https://www.babylonjs-playground.com/#K4UGI8#8) playground but my issue is the intersection point (0,0,0) of xyz axis is not on the center of my model (like on the playground mentioned above - the rotation point is on the center of the box) rather it is on the bottom edge of the model. So that make the rotation weird and unmanageable.
My questions are
- How can I change the rotation focal point from the edge to the center of my model? - that might fix my issue.
- If there is other better way to do/handle mesh rotation?
- how to reset the rotation to the origin/initial point? ( I need this when I return back the model to the shelf, I want to reset as it was before)
Thanks in advance.