How to obtain the changed rotation of mesh?

Hi I am using a plane rotation gizmo to rotate a mesh. How do we get the changed rotation value once the mesh is rotated. Every time i try to log the rotation after rotating the mesh, the mesh rotation is getting displayed as 0 (which i know for a fact that it is wrong).
Kindly let help me in fetching the changed mesh rotation while using plane rotation gizmo.
Also let me know if there is an event that gets fired when i rotate the mesh using plane rotation gizmo? Because i did not find any such event in BabylonJS documents.

Thanks in advance :slight_smile:

There’s no specific event fired when the rotation is changed by the gizmo, but you can track the change of the world matrix and update the selected face accordingly with mesh.onAfterWorldMatrixUpdateObservable (see this PG for an example.

In 4.1 there was a bug where if rotationQuaternion was used instead of rotation on the mesh, it would be nullified by the rotation gizmo and the rotation would be updated instead. So read the rotation property instead of rotationQuaternion if using 4.1.

1 Like