CedricGuillemet / ImGuizmo

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

Camera parented to Guizmo #323

Open Quacksilber opened 7 months ago

Quacksilber commented 7 months ago

What I try to achieve: The active camera shows a gizmo at its center. The camera is parented to an empty in the center. When moving the empty, the camera should follow, thus keeping the gizmo always in its center. This way the camera perspective can be moved, while being in-camera.

This currently only works partially. When clicking e.g. the red arrow and only slightly moving it to the side (then keeping the mouse pressed, but not moving), the camera receives a constant movement on the selected axis. The speed of the movement is directly relational to the distance of the mouse moved from the initial click position. I suppose this happens, as the gizmo wants to move to the clicked position, but the clicked position is moving away, like a donkey with a carrot on a stick.

Is there a way to achieve my desired behavior, or do I need to include a temporary object that keeps track of translation and only applies it to the camera after the mouse has been released? Happy for any suggestions. :)

seenooh commented 2 months ago

Not possible.