The demo doesn't behave correctly if the window is not fullscreen. Even with the in-app recalibrating.
I think to do this properly it maybe necessary to recover the Unity app window's coordinates in screen space, but there doesn't seem to be any obvious way to do this:
http://forum.unity3d.com/threads/how-to ... ion.67228/
π
PS even if it IS fullscreen, I suspect it is going to still be slightly inaccurate because some vertical spaces consumed by Unity's header and footer. (unless the project is built into a standalone app).
UnityGazeUtils.cs contains:
- Code: Select all
public static Point2D getGazeCoordsToUnityWindowCoords(Point2D gp)
{
double rx = gp.X * ((double)Screen.width / GazeManager.Instance.ScreenResolutionWidth);
double ry = (GazeManager.Instance.ScreenResolutionHeight - gp.Y) * ((double)Screen.height / GazeManager.Instance.ScreenResolutionHeight);
return new Point2D(rx, ry);
}
...but that isn't going to work correctly. For example if you're looking at the bottom of the monitor, ry is going to adjust to give you the value for the bottom of the window. Not the same thing. If there is a 1 inch footer, there is now a 1 inch discrepancy between the pixel you're looking at and the pixel it is reporting.