Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

move and rotate holograms

need help with the GestureAction.cs for moving and rotating holograms.
I re-used the GestureAction.cs from Holograms 211.

What I want to do with the hologram:

  • rotate object by holding and drag left-right
  • move object by air-tap, gaze to re-position object, air-tap again to place object down
  • move object across another 3d surface. thinking of locking one of the axis (eg: if object is to move across a 3d floor, y-axis will be locked)

Problems faced:

  • able to rotate, but all objects with script will rotate together. how do I rotate them individually instead?
  • not able to move at all. looks like it does not transition back to manipulation.

any advice on how to edit the script? Thx in advance

Comments

  • or does anyone know how to lock one of the axis while using Manipulator.cs?

  • If you pass in the focused object then only that object will be rotated. I'm working through the academy tutorials but with my own project instead of theirs, and that's what I had to do.

  • @Rewy said:
    If you pass in the focused object then only that object will be rotated. I'm working through the academy tutorials but with my own project instead of theirs, and that's what I had to do.

    @Rewy :
    thx for replying. I added GazeManager.Instance.FocusedObject but still get all objects rotating together.

  • Hmm, maybe it's something to do with the PerformRotation() method.

    The default method is:
    transform.Rotate(new Vector3(0, -1 * rotationFactor, 0));

    Where as in mine I've changed it to:
    FocusedObject.transform.Rotate(0, 1 * xRotationFactor, 0);

    As I mentioned before, my project is laid out differently and my scripts don't contain everything that the tutorials scripts do. Hope you manage to find a fix!

  • @Rewy said:
    Hmm, maybe it's something to do with the PerformRotation() method.

    The default method is:
    transform.Rotate(new Vector3(0, -1 * rotationFactor, 0));

    Where as in mine I've changed it to:
    FocusedObject.transform.Rotate(0, 1 * xRotationFactor, 0);

    As I mentioned before, my project is laid out differently and my scripts don't contain everything that the tutorials scripts do. Hope you manage to find a fix!

    @Rewy
    thx for sharing! works now with the FocusedObject being highlighted.
    I am also using own project with script edited accordingly. currently I am trying to rotate and move objects in the 2 axis using script that uses same concept of TapToPlace.cs / Manipulator.cs and GestureAction.cs .

    but seems like it cancels out the action if both manipulation and navigation is place within same object. Eg: object can only either move using manipulation or rotate using navigation. when placed together nothing will happen. any advice on how to solve this?

    thx a lot

  • Hmm, in the video they use a voice command to transition between being able to use the navigation gesture, and the manipulation gesture. There are also a bunch of other helper methods that they've implemented to facilitate this. Have you implemented these?

    I am yet to implement the manipulation gesture so I cannot provide any of my implementations of these methods. My apologies.

  • Hi, you can try my full tutorial on how to move, resize or rotate objects in your HoloLens apps using MR-Toolkit-Unity 2017.2 version (as latest as it gets) https://codeholo.com/2018/05/06/move-resize-and-rotate-objects-in-your-hololens-apps/

Sign In or Register to comment.