Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use QSettings, change colors, use alpha to indicate hover, use torus for rotate #2

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

onlyjus
Copy link
Contributor

@onlyjus onlyjus commented Apr 8, 2020

Not sure what your direction or thoughts are regarding this project. Made some changes (c++ untested):

  • Use QSettings to save/set user controllable settings
  • Change the x, y, z colors to match Blender 2.8*
  • Adjust plane locations
  • Add keyboard handler (g - translate, r - rotate, s - scale [match blender])
  • Use alpha to indicate when an object is however over
  • use torus as rotation handles

Take it or leave it.

@fferri
Copy link
Owner

fferri commented Apr 8, 2020

A few comments:

  • In my opinion the widget should be as minimal as possible. Storing settings should be responsibility of the application using it. How about leaving the widget with some default values, but adding the Settings from "outside", that is, in main.qml?

  • I do not particularly like the toruses as rotation handles, but that is not only a matter of taste. I think both handle styles (beam and torus) can be supported, but there is a fundamental problem with toruses: the projection of the mouse motion is wrong. Small explanation: mouse motion (x and y delta) is projected on the (projected) screen space vectors (x, y, z) of the reference frame of the gizmo (function projectMotion) and these three projections are used to determine the direction (+/-) and the amount of change to apply in each direction (MouseHandler.onPositionChanged). But I think it is too complicated to determine the projection on the torus due to the fact that you have to take into account also on which point you are on the torus. The beam handle is simpler to work with, and gives the user a more intuitive "motion hint".

  • I tested your version and picking has an issue: items are in the "hovered" state when the mouse pointer is not hover... that does not seem to happen in my version, but I'm not really sure what is causing it. Object picking in Qt3D is a bit iffy.

@onlyjus
Copy link
Contributor Author

onlyjus commented Apr 8, 2020

If you still want to entertain this merge request, I can;

  1. Pull the settings up the main. I guess you want to focus on the gizmos, containted in a couple files so that you can copy those files into other projects?
  2. Revert the torus, make another branch to keep/explore.
  3. I flipped the "hover" look from a dark -> light to a light -> dark, using alpha

I have been trying to mimic the gizmos in Blender, mainly because that is what I know/use. It seems that Blender does find the torus intersection. It also only shows ~half of the torus.

blender_gizmos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants