- 14/09/2020 at 04:34 #18802schiParticipant
Hi there, I am using an HTC Vive Pro Eye in Unity to get an eye gaze visualization. My idea is to be able to see an avatar’s gaze ray, similar to this demo here.
In the case of my project, it is a prerecorded video where I would be recording myself as the avatar with gaze ray. How can I implement this kind of ray visualization and attach the origin of the gaze to an avatar (which would represent the HMD wearer)?
I’m using TobiiXRSDK_184.108.40.206, combined with SRanipal_SDK_220.127.116.11 for see-through video. Thanks in advance, and please let me know if I haven’t explained my question with enough clarity.14/09/2020 at 11:32 #18808Grant [Tobii]Keymaster
Hi @/schi990, thank your for your request. One very simple way to visualize avatar gaze in Unity is to use a Line Renderer using 2 points. The first point would be the origin of the gaze data (p1 = GazeRay.Origin) and the other would be a point along the gaze direction (p2 = GazeRay.Origin + GazeRay.Direction * distance).
One way to improve upon this is to make the second point dynamic and adjust its distance if any objects along the gaze direction are intercepted (you can raycast and if something is intercepted, adjust to that distance, otherwise set an arbritary distance such as 10 meters).
Another improvement could be to set a static point for the origin of the gaze ray visualization (p1). If you don’t do this, the gaze visualization origin will move with the GazeRay.Origin signal (it adjusts to be as accurate as possible, but in the case of avatar gaze visualization you might want to optimize for it looking good and steady instead of eye tracking data optimization).
Please try this out and let us know how you get on. Best Wishes.
- You must be logged in to reply to this topic.