Home Forums Software Development how to get the gaze coordinate?

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
  • #2940
    Na Cui


    I want to know how to get the real-time Eye Tracker’s gaze coordinate of X, Y.

    I need implement a programming which can read the gaze coordinates.

    I have no idea about how to start it.

    Please give me some advice.

    Thank you very much!

    Dolores Joya

    I was able to successfully get a Gaze coordinate data stream to successfully build with Microsoft Visual Studio Community 2013 after going through these:

    These 2 tutorials got me started:

    The data steam from the MinimalGazeDataStream Visual Studio project output looks like this:

    Gaze Data: (384.5, 161.9) timestamp 605378864 ms
    Gaze Data: (385.1, 163.0) timestamp 605378880 ms
    Gaze Data: (390.3, 182.0) timestamp 605378895 ms
    Gaze Data: (392.9, 188.2) timestamp 605378927 ms
    Gaze Data: (402.1, 198.5) timestamp 605378937 ms
    Gaze Data: (404.4, 202.6) timestamp 605378954 ms
    Gaze Data: (402.4, 186.8) timestamp 605378970 ms
    Gaze Data: (402.6, 178.0) timestamp 605378981 ms
    Gaze Data: (402.6, 164.8) timestamp 605378998 ms
    Gaze Data: (401.6, 159.5) timestamp 605379013 ms

    Coming from:
    * Handles an event from the Gaze Point data stream.
    void OnGazeDataEvent(TX_HANDLE hGazeDataBehavior)
    if (txGetGazePointDataEventParams(hGazeDataBehavior, &eventParams) == TX_RESULT_OK) {
    printf(“Gaze Data: (%.1f, %.1f) timestamp %.0f ms\n”, eventParams.X, eventParams.Y, eventParams.Timestamp);
    } else {
    printf(“Failed to interpret gaze data event packet.\n”);

    Tala Al Bahar

    I’m using Visual Studio 2013. I ran the SDK projects for MinimalGazeDataStream and MinimalFixationDataStream but I still can’t see any output on the console including the printout of the coordinates and timestamps.
    I’ve calibrated and tested the eye tracker and it works fine. Please let me know if you have any suggestions that could help. Thanks

    Patrik [Tobii]

    Hello Tala,

    Does it say “Listening for gaze data, press any key to exit…” or is the console window blank?

    / Patrik

    Tala Al Bahar

    Hello Patrik,

    Actually, I am not even getting the console window at all. I changed the configuration to “Console (/SUBSYSTEM:CONSOLE)” for MinimalGazeDataStream project but I’m still not getting anything. I found out that whenever I run any of the sample projects of the SDK, the ActivatableButtons main function gets called, and I can’t change the configuration there to (/SUBSYSTEM:CONSOLE).
    Do you have any idea what I might be missing?
    (I tried writing to files from all the main functions and the only file that gets created/edited is from the ActivatableButtons project – and this happens every time I run any of the codes).


    Tala Al Bahar

    Sorry, I meant only the “ActivatableBoardGame” main function is being called in all cases

    Patrik [Tobii]

    Hello Tala,

    You need to right click on the project you want to run and select “Set as StartUp Project”.
    When you press F5 (Start debugging) the correct project should run.

    Best regards



    because of you
    Data is displayed on the console.

    I want to write to text file.

    I write (fopne) .(fputs) etc in [void OnGazeDataEvent]
    But not work and error {(code 1120) Linker error….}

    No place to write is different ?
    Writing ‘s the difference ?
    And you wonder why good in trouble too

    I am not sorry at rudimentary questions

    The answer I wrote in want to be about hints ‘ s not

    If there is a reply I’m glad .

    Niigata,Japan AE


    Use environment

    Windows7  TobiiEyeXSdk-Cpp-1.5.466
    MinimalGazeDataStream in samples

    Niigata,Japan AE

    Jenny [Tobii]

    Hi AE,

    Seems you have some unresolved externals. Check the link error preceding the 1120 error to see what externals cause the problem. Since the gaze data is displayed in the console it seems it is not a problem with the EyeX dlls.

    Found this on MSDN: https://msdn.microsoft.com/en-us/library/z98k84c3.aspx

    Please, also read through the EyeX license agreement. You should not store gaze data to file using EyeX.


    Hi Joya
    I downloaded these codes. the game is successfully running. but the code you have mentioned to extract gaze data does not work for me.
    could you please help me?

    Grant [Tobii]

    Hi @sadanas, this thread is somewhat old so I’m not sure @doloresjoya is necessarily checking this, but if you could kindly be more specific in the issue you are facing, perhaps someone else from the community can help you out.. thanks!


    Hello! I am new with Eye tracking and I am doing project for college and decided to make a game in Unity(version of a flappy bird) and use EyeX in the simplest possible way and that is to find out the coordinates of my game object and find out the coordinates where my eyes have looked while playing that game ,and basically to compare those two.
    I have found the script in Assets/Tobii/DemoScenes/Scripts/Example01 -> PrintGazePosition. Maybe it is a silly question but I’m having trouble with that script, I added it to my player(main gameobject) and I don’t know where it is supposed to print those coordinates and should I add something to that script because it constantly reports error: Object reference not set to an instance of an object.
    (Maybe you have other suggestion for my problem )

    P.S. Unity 5.5 3D project , but it is made as a 2D game 😉

    Please,help I’m running out of time! 🙂

    Alex [Tobii]


    Do the demo scenes work fine for you? Does it print the coordinates in demo scene1?


    No, it doesn’t 🙁 Maybe I am doing something wrong..

    Is it possible to print the coordinates no matter what framework is it,I mean some tool just to see the coordinates where the eyes have looked on the screen? (Maybe in notepad or something like that)

Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.