ImGuizmo icon indicating copy to clipboard operation
ImGuizmo copied to clipboard

How can modify the code to achieve this scaling gizmo

Open lungsdude opened this issue 1 year ago • 4 comments

Hello, this is not actually an issue with the library, I just find the library to not be sutible for what I am trying to achieve. The default scaling gizmo scales the model in 2 directions. Brick-Stacker-OpenGL_2elXmeQSta But this is the style of scale gizmo I want to achieve, where there are these sticks in 6 directions, and not only 3. Note that I am not aiming for copying the visual look, only the behaviour. BrickBuilder_M7kbZEvgw0 (2) (2) I don't ask for this to be implemented into the library itself, I am just a little bit confused about how to approach doing this. In advance, thanks.

lungsdude avatar Jul 05 '23 10:07 lungsdude

gizmos are processed in 3 steps. For example, using scaling gizmo:

  • It is rendered:https://github.com/CedricGuillemet/ImGuizmo/blob/822be7b44c37dbe98d328739ebe0d5a1ea87ecfc/ImGuizmo.cpp#L1342
  • operation is determined based on mouse position https://github.com/CedricGuillemet/ImGuizmo/blob/822be7b44c37dbe98d328739ebe0d5a1ea87ecfc/ImGuizmo.cpp#L1883
  • finally, matrix is computed https://github.com/CedricGuillemet/ImGuizmo/blob/822be7b44c37dbe98d328739ebe0d5a1ea87ecfc/ImGuizmo.cpp#L2206

I suggest you to try to have the display correct with all the axis you need. then try to detect various hot areas for your gizmo. and at the end, compute the corresponding matrix.

CedricGuillemet avatar Jul 05 '23 12:07 CedricGuillemet

Ok, thanks, I'll tinker with it as soon as possible. 👍

lungsdude avatar Jul 05 '23 17:07 lungsdude

@lungsdude did you ever figure out how to do this? also curious

ddetone avatar Feb 15 '24 15:02 ddetone

@ddetone sadly I couldn't achieve anything, so I am stuck with default behaviour

lungsdude avatar Feb 22 '24 19:02 lungsdude