Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. 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 () - 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.