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.

Gaze Pointer

Please help me how to implement a pointer similar to the one which they used in the CWU video at 1:02 (https://www.youtube.com/watch?v=567Eb-Gccn8) - so that when we share the model students can see where exactly the lecture is looking at

Tagged:

Comments

  • mark_grossnicklemark_grossnickle ✭✭✭
    edited March 2017

    I'm not sure if we wrote this or if it was from a prior HoloLens toolkit but you can create a message to send the camera location and head rotation of the instructor. Something along these lines:

    {code}
    // Send the user's position each frame.
    void Update()
    {
    if (ImportExportAnchorManager.Instance.AnchorEstablished)
    {
    // Grab the current head transform and broadcast it to all the other users in the session
    Transform headTransform = Camera.main.transform;

            // Transform the head position and rotation into local space
            Vector3 headPosition = this.transform.InverseTransformPoint(headTransform.position);
            Quaternion headRotation = Quaternion.Inverse(this.transform.rotation) * headTransform.rotation;
            RemotePlayerMessages.Instance.SendHeadTransform(headPosition, headRotation, 0x1);
        }
    }
    

    {/code}

    Then you would need to listen for that message and grab the camera location and head location in your student version. Place your graphic at that location and rotate it accordingly.

    You could also pass in the cursor location if you wanted to draw a line from the camera to the location where the instructor's gaze is located.

    Taqtile

  • mark_grossnicklemark_grossnickle ✭✭✭
    edited March 2017

    The following will allow you to send the location of the teacher's head. The students will then need to grab the location of the head and its rotate and draw the line.

    You could also send the cursor location and draw the line from the head to the cursor to get the full path of the gaze.

    Sorry for the formatting. Not sure how to paste code here. :/

    // Send the user's position each frame.
    void Update()
    {
    if (ImportExportAnchorManager.Instance.AnchorEstablished)
    {
    // Grab the current head transform and broadcast it to all the other users in the session
    Transform headTransform = Camera.main.transform;
    // Transform the head position and rotation into local space
    Vector3 headPosition = this.transform.InverseTransformPoint(headTransform.position);
    Quaternion headRotation = Quaternion.Inverse(this.transform.rotation) * headTransform.rotation;
    RemotePlayerMessages.Instance.SendHeadTransform(headPosition, headRotation, 0x1);
    }
    }

    Taqtile

  • @mark_grossnickle Thanks for sharing the code. Can you please help by sharing the complete code to draw the line as well. Does this allow the teacher also to see the pointer line?

    Formatting the code not a problem i will take care of it.

  • Check out Vectrosity in the asset store or Unity's new line renderer to draw the line.

    I am not sure if you'd want the teacher to see a line wherever they are looking. I think it would be distracting. But if you do, just find the camera location and the cursor location and draw between those two points.

    Taqtile

Sign In or Register to comment.