- 26/06/2015 at 04:00 #3166RussellParticipant
I’m new to developing for the Tobii EyeX, and am trying to make a simple 2D OpenGL application with buttons that detect gaze/fixation. I based it on the sample Visual Studio projects provided. I’ve succeeded, but only by taking the gaze/fixation eventParam coordinates and offsetting them. The result is only accurate for me and my profile.
Page 23 of the Developer’s manual talks about using the ClientToScreen and ScreenToClient functions available to Windows users (btw, I eventually want to port this to Linux) to get accurate coordinates, but Tobii’s eventParams.X and .Y are doubles, while the ScreenToClient function takes a POINT who’s .x and .y are long ints. Casting between a double and a long int and back again hardly seems the right way to go, so I’m unsure what to do.
Any ideas/suggestions on what do/where to look for answers?07/07/2015 at 17:34 #3214Jenny [Tobii]Participant
Explicit and implicit casting is actually what I would suggest to use and what we are using in the EyeX SDK samples that have a GUI. Any roundoff errors should be insignificant compared to the overall precision possible with eye tracking. I can’t remember now why the coordinates ended up being real values in the API – we are after all talking about physical pixels which only makes sense as integer values. Anyhow and anyway, there is code in the ActivatableButtons sample that uses the ClientToScreen function.
Furthermore, since what you want to have is buttons that detect gaze, I would like to point out that we have this feature in the EyeX Engine API. If you define a region on the screen to have the Gaze Aware behavior, and inform the EyeX Engine of this region when the engine asks for information about that particular part of your application window, the EyeX Engine will raise events when the HasGaze status of that region changes – true if it is being looked at, and false otherwise. The Gaze Aware behavior feature also takes into consideration other EyeX region around the current region, the empty space with no regions and regions in other application windows next to yours, when deciding if the user is looking at this particular region or not. The filtering and heuristics are quite extensive to create a consistent user experience – and you can tap into this not having do implement your own filtering and heuristics.
The ActivatableButtons sample shows how to define a region with the Activatable behavior. The GazeAware behavior is similar but does not require the user to press a button, and you can define a delay in ms how long the user has to look at a region before the EyeX Engine raises a ‘HasGaze = true’ event.
- You must be logged in to reply to this topic.