Position Gizmo Y-axis flips in World Coordinate Mode when mesh has negative scaling

I encountered an issue with the Position Gizmo in the Sandbox. When a mesh has negative scaling applied, the Y-axis of the translation gizmo flips and points downwards. Interestingly, this issue only occurs when the Coordinates Mode is set to “World”; if it is set to “Local”, the gizmo behaves correctly.

Steps to reproduce in Sandbox:

  1. Open https://sandbox.babylonjs.com/ and drag-and-drop a custom 3D model into the scene.
  2. Open the Inspector and select the mesh.
  3. Enable the Position Gizmo (Translation).
  4. Set the Coordinates Mode to World (the globe icon).
  5. Change the mesh’s Scaling to negative values. The Y-axis flips downwards in several scenarios, for example:
    • Only X is negative (e.g., X=-1, Y=1, Z=1)
    • Only Y is negative (e.g., X=1, Y=-1, Z=1)
    • Only Z is negative (e.g., X=1, Y=1, Z=-1)
    • All axes are negative (e.g., X=-1, Y=-1, Z=-1)

Actual behavior:
In World mode, the Y-axis arrow of the gizmo flips from pointing upwards to pointing downwards under the negative scaling conditions mentioned above. (Note: In Local mode, it works perfectly fine).

Expected behavior:
Since the Gizmo is in World mode, its axes should always remain fixed and strictly aligned with the global World axes (Y always pointing up), completely ignoring the mesh’s local scaling or rotation.

Thank you for looking into this!

I use the default sphere from the https://playground.babylonjs.com.

Is it possible that it is not really “world” but “absolute” (in Babylon terms).

E.g. if you set sphere.scaling.x = -1 and if you select the sphere in the inspector, then open dev console and type “debugNode”. This is the sphere mesh. Now compare .rotation and .absoluteRotationQuaternion.toEulerAngles().

They differ (if scaling.x=-1) on rotation.z == PI, i.e. rotation around z by 180°. If I see this right, this matches the observation when switching between local and world mode.


True world axes would be nice though because try rotating the -x’ed sphere and compare local/world mode. I find this (how the ‘world’ axes are displayed) rather confusing :face_with_crossed_out_eyes:

I agree! This is weird. I guess it’s for legacy reason and a bunch of conversions here and there. I’ll take a look to check if something is possible without breaking it for most people.