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.
Options

Rotating Holograms

I want to rotate a hologram in x, y and z not just y direction like they have done in Holographic 211. Everytime I try to do it for X as well, it just doesnt work. Any suggestions @HoloSheep or anyone?

Tagged:

Answers

  • Options
    ahillierahillier mod
    edited August 2016

    Hi @nayanseth,
    If you want to allow for rotation along x, y, and z, then you'll need to add support for NavigationY and NavigationZ to GestureManager.cs, like so:

            NavigationRecognizer.SetRecognizableGestures(
                GestureSettings.Tap |
                GestureSettings.NavigationX |
                GestureSettings.NavigationY |
                GestureSettings.NavigationZ);
    

    If you're using similar scripts to the 211 course, you would then modify GestureAction.cs to respond to the user's hand movement in all directions. Here's a very rudimentary function that will rotate the model in x, y, and z:

        private void PerformRotation()
        {
            if (GestureManager.Instance.IsNavigating)
            {
                // If user is moving their hand left/right (Navigation_X), rotate along the Y axis
                float rotationFactor_Y = GestureManager.Instance.NavigationPosition.x * RotationSensitivity;
    
                // If user is moving their hand up or down (Navigation_Y), rotate along the X axis
                float rotationFactor_X = GestureManager.Instance.NavigationPosition.y * RotationSensitivity;
    
                // If user is moving their hand forward/backward (Navigation_Z), rotate along the Z axis
                float rotationFactor_Z = GestureManager.Instance.NavigationPosition.z * RotationSensitivity;
    
                // Apply rotation to object
                transform.Rotate(new Vector3(rotationFactor_X, -1 * rotationFactor_Y, rotationFactor_Z));
            }
        }
    

    For usability purposes, I would suggest locking at least one axis (Z), as rotating in all 3 directions can get confusing. You could also require the user to specify which axis to rotate around (either a button or voice command), so that only one rotation is applied per navigation gesture detected. This would give finer control to the user for rotating the object. You can also change the rotation speed by altering the RotationSensitivity value in the GestureAction script.

    I hope this helps,
    ~Angela

  • Options

    Even if I add the GestureSettings.NavigationY | GestureSettings.NavigationZ , I am not getting any calls in method "NavigationRecognizer_NavigationUpdatedEvent" when I move the hand guesture towards up or down !
    Its still working for X axis.. but not for Y and Z.
    Can you please help me?

  • Options

    I have exactly the same Problem. @shinoybabu did you found a solution?

  • Options

    Stupid as I am, I made the Gestures Input with the Emulator wrong.
    Wrong: mouse right hold + move
    Correct: alt + mouse right hold + move

    @shinoybabu try that.

Sign In or Register to comment.