Page 1 of 1

Getting data

PostPosted: 19 Feb 2014, 10:54
by giannismoustakis
This is a conversion code from C# to Java.

Code: Select all
import com.theeyetribe.client.GazeManager;
import com.theeyetribe.client.IGazeListener;
import com.theeyetribe.client.data.GazeData;

public class GetData  implements IGazeListener 
{
   
      public static void main (String[] args)
      {
            new GetData();
      }
      
      
      GetData()
      {
            GazeManager.getInstance().activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.PUSH);
            GazeManager.getInstance().addGazeListener(this);
      }
      
      
      public void onGazeUpdate(GazeData gazeData)
      {
         double gX = gazeData.rawCoordinates.x;
         double gY = gazeData.rawCoordinates.y;
         //double gX = gazeData.smoothedCoordinates.x;
         //double gY = gazeData.smoothedCoordinates.y;
         System.out.println( gX + "\t" + gY);
      }   
}

Re: Getting data

PostPosted: 10 Mar 2014, 06:04
by HackNFly
Thanks for the code, it was a helpful start!