-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Direction vector/rotation widget #2811
Comments
Have a look at eg #942 to write your own widget. You may also check the wiki for things like ImGuizmo which are designed for 3d space but may work just as wel in a window?
|
Hi, @DiligentGraphics You can manipulate an object/light, in your ImGui window, adding only 4 code lines!. It uses quaternions algebra, internally, to manage rotations, but offers the possibility also to interfacing with vec3, vec4 or mat4x4 (rotation). There are also two live WebGL demo to test widgets in main page: imGuIZMO.quat I use it also in my project: glChAoS.P: was developed for it. |
@BrutPitt That looks fantastic, thanks for sharing! I will certainly take a look later today. |
@BrutPitt Thanks again, your widget works really well! @ocornut It was certainly little unexpected that dear imgui has so many cool advanced UI features, but does not provide this really basic widget. Do you have a list of extension widgets developed by community? I think this one should definitely be in such list. |
@DiligentGraphics Thank you and thanks for the appreciation, I'm glad it's useful to you. imGuIZMO.quat was born of a personal need, so currently some settings/features were not designed/thought with the needs of third parties in mind. But it could be also thought making it totally standalone, rewriting just the sub-set of vectors / quaternions operations used . Anyway I am open to constructive dialogue and new ideas |
@BrutPitt It took me a couple of hours to replace glm and remove dependencies on other headers. Making this widget a standalone component will not require a lot of work. |
There's a list in the wiki:
I wouldn't mind if we had an official widget for that if someone submitted, perhaps in the imgui_club repo if it's big? But requires a certain extra workload to promote code from "working in my codebase, with my dependencies" to "everyone can use it". It's also healthy to push toward moving less responsability off me and sharing that work with many third parties such as Michelle and Cedric so I'm happy with the current situation. If anything we could improve discovery of those widgets through better doc/wiki pages. I think https://github.com/CedricGuillemet/ImGuizmo doesn't rely on glm, I however don't know how ImGuizmo and imGUiZMO.quat compares in term of features. glm: very adequate for many tasks but I think most mid-scale console gamedevs wouldn't touch it because of how template-heavy it is (compile-time issues etc.), so my gut feeling is that anything using glm would drop plenty of users, but there's hardly a better solution other than using lower-level types made yourself. Note that ImVec2/ImVec4 are designed to be configured in imconfig.h so we could imagine using more of use in |
@ocornut thank you! |
Hello!
I am trying to find a way to input normalized direction vector (such as light direction) as well as rotation. My current solution for direction is as follows:
This however does not work really well as it is hard to control and understand. My old UI library that I am currently getting rid of has nice widgets for both direction and rotation data:
Is there any way to get something similar with dear imgui?
The text was updated successfully, but these errors were encountered: