Rotation gizmo doesn't follow the rotation of the mesh

In the playground below, I have a cube mesh with scaling and rotation gizmos attached to it.
The X-axis of the rotation gizmo has a custom mesh which is the pink box in the middle.
It also has the updateGizmoRotationToMatchAttachedMesh flag set to false to make it work even if the scaling of the attached mesh changes.

The issue is that when rotating the mesh with the X-axis rotation gizmo, the custom mesh for the gizmo (pink box) doesn’t rotate along.

Can anybody help with this?
Thank you

it doesn’t rotate along since you set updateGizmoRotationToMatchAttachedMesh = false;
doing that will keep the gizmo aligned to world coordinates.

but rotation on scaled mesh should work despite that. maybe @Cedric could help ?

Yesm I think it should work without the need of those flags. I’ll take a closer look this week.

1 Like

I was wrong, you need to set updateGizmoRotationToMatchAttachedMesh to true to see the custom mesh being updated when rotating.

1 Like

yess indeed.

what if no custom mesh was set, and the updateGizmoRotattionToMatchAttachedMesh is set to true.
if I perform a scale (either uniform or non uniform ? I’m not sure), I should be able to rotate that scaled mesh right ?

if yes then it’s not the case here.

yes with a uniform scale. non uniform scaling is more problematic and can lead to skewed matrices. so, it’s not allowed with gizmos.

1 Like

fair enough !