ImGuizmo icon indicating copy to clipboard operation
ImGuizmo copied to clipboard

Rotation on the y axis flips the others

Open PierreMauger opened this issue 1 year ago • 6 comments

Screencast from 19-03-2023 00:09:24.webm

When rotating a guizmo on the y axis, in local or world space, the x and z axis jumps to 180° or -180° after a 90°. I've looked into the code, and I believe the calc is done on this function "void matrix_t::RotationAxis(const vec_t& axis, float angle)" (currently line 554 in ImGuizmo.cpp), but I can't understand what's causing the issue.

It is not visually an issue, as if you flip the other axis, the 3d model looks the same, but the direction is upside down, breaking the rest of my code, forcing me to disable the guizmo for my editor to work properly.

If anyone have any idea how to fix this or help me understand why this is happening, I would gladly try to contribute.

PierreMauger avatar Mar 18 '23 23:03 PierreMauger

can confirm, did you find a fix for this?

mokafolio avatar Jul 21 '23 16:07 mokafolio

No, I still haven't found how to fix it. I believe this is an intended behavior, and changing it would require more matrix computations (cannot say for sure). If so, it would be nice to be able to choose for a more heavy but more stable function...

PierreMauger avatar Jul 24 '23 12:07 PierreMauger

Do you mean, changing one axis affect other ones?

sametydev avatar Aug 24 '23 20:08 sametydev

Do you mean, changing one axis affect other ones?

If you mean this, I have same problem too, I'm moving only one axis, but its affect on other axis (If other axis are moved)

sametydev avatar Aug 24 '23 20:08 sametydev

I've also been suffering with this issue rotating around Y Axis 180 degrees...

timbeaudet avatar Nov 09 '23 14:11 timbeaudet

Trying to reawaken this issue, I'd love a solution and have spent the last several hours digging through my code trying to find a solution, but I think it is shoved inside DecomposeMatrixToComponents() which claims to (and has) numerical instabilities, but ignore slight precision loss, why does rotating ONLY Y axis start modifying X and Z?

timbeaudet avatar Sep 22 '24 16:09 timbeaudet