Jump to content

Get Focussed Vector

Recommended Posts

I am trying to get the focus of the focussed point. Therefore I have multiple ideas:


1) Calculate the intersection of the line consisting out of data.verbose_data.left.gaze_origin_mm and data.verbose_data.left.gaze_direction_normalized (left eye line) as well as  data.verbose_data.right.gaze_origin_mm and data.verbose_data.right.gaze_direction_normalized (right eye line). Unfortunately, this doesn't return an intersection point because they do not cross each other.


2) I saw that Tobii XR SDK offers a function "GetEyeTrackingData" (https://vr.tobii.com/sdk/develop/unity/documentation/usage-examples/). Unfortunately the class TobiiXR has no function GetEyeTrackingData and therefore I am not able to use it.


Does anyone has any idea/ideas?

Link to comment
Share on other sites

@Dario Yes I already looked into this example. But within this example, I have to "define" which objects can be focussed.

But I just want to get the point of focus, indepent if a person focussed an object or just watch into the air.

Therefore I thought about the following idea:

I can receive the eye data via SRanipal_Eye_API.GetEyeData(ref data) and therefore have the eye data of the left, right eyes as well as the combined data.

So in the next step I am calculating the focussed point by calculating the minimal distance between the two lines of the left and right eye. If the minimal distance is 0, they have an intersection point:

lineLeft= gazeOrigin_left + l * normalizedGazeDirectionVector_left

lineRight= gazeOrigin_right + k * normalizedGazeDirectionVector_right



  • gazeOrigin_left == data.verbose_data.left.gaze_origin_mm
  • normalizedGazeDirectionVector_left_left ==  data.verbose_data.left.gaze_direction_normalized
  • gazeOrigin_right == data.verbose_data.right.gaze_origin_mm
  • normalizedGazeDirectionVector_right ==  data.verbose_data.right.gaze_direction_normalized


Unfortunately the two lines do not have an intersection point, but I do not understand why.


Anyone has any ideas why there is no intersection point? 


Link to comment
Share on other sites

  • 10 months later...

Maybe I'm wrong but I wouldn't expect the lines to actually intersect; that would require absolutely perfect tracking for both eyes. So if you have the equation for the lines, maybe find their closest points to each other and use a point in between as your focus? This might help in that regard: https://math.stackexchange.com/questions/1993953/closest-points-between-two-lines @Dario @Corvus @Daniel_Y

Link to comment
Share on other sites

  • 2 weeks later...

@Annabell @killerbee @AstroVR 

If someone is not focusing on an object (i.e. "staring off into the air") then each eye's gaze vector will generally not intersect. Even with perfect tracking quality, the eyes may be looking parallel at a far enough away point and parallel lines do not intersect.


When looking into the distance, the eyes diverge until parallel, effectively fixating the same point at infinity (or very far away).


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...