Tagged: gaze position
- 24/03/2021 at 13:20 #20082Yotam Hagur-BahatParticipant
Hello, I am using the HTC VIVE PRO EYE and I want to record the X,Y,Z position of the gaze.
Where can I find this function? I built a simple scene according to the tutorial and it works. I have in the scene the TobiiXR Initializer and I put on the object the ‘Highlight At Gaze’ script. But I can’t find where TOBII calculate the X, Y, Z position so I can take it from there.25/03/2021 at 16:31 #20086Grant [Tobii]Keymaster
Hi @yotam, within the Tobii XR SDK we provide the gaze origin and direction. From that, one can calculate a vector from the simple formula ‘gaze.origin + gaze.direction * length’. With this you can use a raycast in Unity to determine if that ray intersects with any objects in your scene and that will get you the the (x, y, z) of the intersection point. Info on Raycast @ https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
Hopefully, this is the information you are looking for! Let us know how it goes, best wishes.29/03/2021 at 07:44 #20096Yotam Hagur-BahatParticipant
Thnx for the quick reply.
I tried to look for the gaze.origin and gaze.direction but it seems that these two functions are not recognized.
I created a new script, added ‘using TOBII.XR’ but the function are not recognized. I tried to put the script under ‘TOBIIXR’ directory, but still UNITY doesn’t recognize the function. What am I doing wrong ?
Yotam29/03/2021 at 12:54 #20097Grant [Tobii]Keymaster
Hi @yotam, we have created a detailed walkthrough and tutorial with appropriate code included which demonstrates using the gaze ray which you can find @
This should hopefully show you exactly what you need to do. Please go through this and let us know how you get on. Best Wishes.
- You must be logged in to reply to this topic.