Units of eye coordinate data




  • Avatar

    IFVRHeadset::GetGazeVector in our C++ SDK returns a normalized directional vector, where X is right, Y is up, and Z is forward. Note: if there's an error the vector itself is undefined and might not have unit length.

    Since it's a direction, you can get a world coordinate by adding it to the camera position to that eye. You may want to multiply it by some distance beforehand to get a world coordinate sufficiently far from the camera, depending on what you're trying to do.


  • Avatar
    Owen Atkinson

    Hi Jeff,

    You mentioned the z axis is forward, what exactly do you mean by this?

    For example, I am using a simple unity scene to gather x,y,z coordinates.

    To increase & decrease the x and y axis i can simply look left to right & up and down.

    How would I trigger the z axis to increase and decrease?



  • Avatar

    The left/right eye gazes are directional unit vectors, so the magnitude is always one.

    This means x*x+y*y+z*z=1

    So if you look directly forward, z will be 1 and x/y will be 0. As you look to the sides you modify x/y and z must shrink to balance the equation and keep it a unit vector. So that's the only meaning of Z in this case.

    I think what you may be thinking of is the Z distance of the item is being looked at, the gaze point. That is provided by the convergence function `GetGazeConvergence`. However, this info relies on both eyes so it's not available if the user has one eye closed. It's also is increasingly approximate as you look at more and more distance objects.

    The other way to get the gaze point is to raycast into the world along the gaze vector from one or both eyes, which will give you the gaze point.

    You can even combine the two methods and use the convergence distance to disambiguate hits if the ray has multiple collisions with the world.

Please sign in to leave a comment.