CedricGuillemet / ImGuizmo

Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui
MIT License
3.22k stars 907 forks source link

scaling doesn't work #296

Closed 0LGL0 closed 1 year ago

0LGL0 commented 1 year ago

Hello, I have a problem with the Scale operation in gizmo. Here are videos where you can see the problem:

https://user-images.githubusercontent.com/81826990/229302131-27aa660a-b055-45cf-b3ce-7c03cd642f8f.mp4

And when I first move the object, and then start scaling, then this is what happens:

https://user-images.githubusercontent.com/81826990/229302133-4ba24950-ed5e-42b1-b7ec-096c0c9d73bc.mp4

I immediately apologize for the inscription on top of the video. And yes, this problem is only with scaling. Also here is the code where I draw gizmo: https://gist.github.com/0LGL0/9ca296b0023d864901a8ce1e81e24f8f

CedricGuillemet commented 1 year ago

Can you please try to repro the issue in the imguizmo sample?

0LGL0 commented 1 year ago

Hello, I immediately want to apologize for not answering for a long time. If I understood you correctly, I needed to run the example code and see if it works, although it's possible that you didn't mean it. But I ran this code, and everything was fine there, and moving, and rotating, and zooming worked fine, and the nodes also worked.

0LGL0 commented 1 year ago

Hello again, I think I found the reason why there is such a flickering of the axes. The fact is that the axes flicker only when the object on which gizmo operations are performed is in zero coordinates (Translate). That is, in order for the flicker to disappear, you need to move this object at least a little (a shift of 0.001 unit was enough for me). And yet, if this object is shifted, for example, only along the X axis, then the flickering disappears only for the X axis, and the Y axis will continue to flicker until it is also shifted. And I have not figured out how to solve the problem with incorrect scaling on the X axis. It is strange that in general all other operations and Scale on the Y coordinate work fine, but Scale on the X coordinate does not.