MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Object manipulation with variable control to display ratio

Open FelixWeichselgartner opened this issue 2 years ago • 5 comments

Object manipulation with variable control to display ratio

I want to precisely position an object with gestures. Therefore, I would like to use a 1:1 control to display ratio for rough positioning in the destination area and later use a e.g. 5:1 ratio for precisely reach my destination.

Describe the solution you'd like

Introduce a float variable (for the object manipulator script), that can be modified in code. The manipulation then uses the float (which is control/display) for the manipulation.

Maybe there is also a solution that I change one variable in code and this applies to all object manipulations.

Additional context

I haven't found anything related, maybe there is already such a variable but not accessable or I simply didn't find it yet.

FelixWeichselgartner avatar Oct 26 '21 14:10 FelixWeichselgartner

Hey @FelixWeichselgartner, thanks for filing this feature request. Can you elaborate more on the scenario you would use this in? I was thinking for moving very small or very large objects and am curious if that's what you were thinking too.

polar-kev avatar Oct 26 '21 20:10 polar-kev

@polar-kev

What I mean is not about the size of the object per se.

Let's say you have a CAD model of a chair and a physical chair and you want to align the digital model with the physical chair. The model spawns let's say 2 meters away. Then you pick it up with your normal gestures and place it near the chair. Now you maybe an error left of about 3cm (roughly one inch). So you move the object with your gestures 2 meters and the object itself therefore also moved 2 meters. So far thas the current state with MRTK. To precisely align the objects (goal is maybe 1mm error), it's hard to do that with this setup. Therefore it would be nice if doing a gesture to move the object 5 inches would only move the object 1 inch -> The control to display ratio (short CD ratio) would be 5 here. With this setup is way a lot easier to align the objects.

A real world comparison would be the gear in your car. You choose a lower gear for parking and a higher gear for the highway.

FelixWeichselgartner avatar Oct 27 '21 06:10 FelixWeichselgartner

A temporary solution for anybody with the same need would be:

  • Spawn two objects that can be modified with gestures: Object 1 (which you actually want to position) and Object 2 which is a temporary object
  • You roughly position Object 1 (as explained above)
  • Link the transform.position of Object 2 in a script to the transform.position of Object 1 with your CD ratio
  • Therefore, when Object 2 is modified with gestures, Object 1 will move less (if CD > 1)

The issues is that you focus on Object 2, while you actually want to focus on Object 1 while positioning.

FelixWeichselgartner avatar Oct 27 '21 08:10 FelixWeichselgartner

Im not sure because there is not a lot of documentation in the script itself: https://github.com/microsoft/MixedRealityToolkit-Unity/blob/265a0ea3621c84b88e4b02e7fcd1b5682afef56a/Assets/MRTK/SDK/Features/Input/Handlers/Manipulation/ManipulationHandler.cs#L788 Here the change in transform.position which is set for the manipulated object has to be multiplied by cd_ratio. (Would be my best guess)

FelixWeichselgartner avatar Oct 27 '21 08:10 FelixWeichselgartner

Thanks for the breakdown @FelixWeichselgartner. @Zee2 started some research a while back into new interactions geared towards precision manipulation that I think would cover your scenario.

polar-kev avatar Oct 29 '21 19:10 polar-kev

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!

IssueSyncBot avatar Jan 13 '24 00:01 IssueSyncBot