Home › Forums › Game Integration › unity gazePosition -> mousePosition
Tagged: Unity
- This topic has 6 replies, 2 voices, and was last updated 7 years, 4 months ago by tiblop.
- AuthorPosts
- 03/05/2017 at 15:44 #6784tiblopParticipant
Hello,
I am using the eye tracker in unity.
I have made a setup where my mouse position activate things if it is over buttons.
I want to switch to eyeGaze position instead.
However, I have noticed that the gazeposition is shifted compare to the mouse position. It seems to depend to the width and height of the window.I tried to find out from how much it was shifted so I have put my mouse on the middle of my gaze trace for many iterations on different places.
After some test i found that for my 761×385 window, the gaze is shifted bymousePositionX = gazepositionX * 0.8 + 300
mousePositionY = gazePositionY * 0.8 + 160but it depend from many things and it seems to change each time i reposition, resize the window…
Is there any way to convert the gazeposition to mousePosition( represent it , like if my mouse would be moving with my eyegaze it would be the same ?thank you
Thank you03/05/2017 at 16:52 #6787tiblopParticipantI also tried to use gazeAware but unity says ” it seems a Gaze Aware component has been attached to a UI element, which is not supported. GazeFOcus can only be detected on a 3D and 2D GameObjects whith a collider”.
However, I created a collider around my UI Button .
It seems like there is an ActivatableGUI demo that explain how to do but i cannot find it :/
Thank you03/05/2017 at 21:33 #6788Alex [Tobii]ParticipantHi!
1. I’m afraid there’s an error in the documentation. GazeAware component only works for 3D objects. For 2d objects you might need to do bounds check manually. So just read your canvas element bounds in Screen coordinates add a margin and compare it with gaze point coordinates. You might also want to add some stickiness or your selection might jump between several objects.
2. Unity SDK is the only SDK compatible with Unity.
3. We will soon release a major update for the Unity SDK with an example for CleanUI feature that does the bounds check you need.
04/05/2017 at 10:41 #6791tiblopParticipantHello,
As I said, I tried to use the gazePosition but it is wrong compared to the mousePosition. Using mousePosition works perfectly but gazeposition is always shifted . why? How to get the exact gazeposition that would correspond to the associated mousePositionthank you
04/05/2017 at 11:32 #6792tiblopParticipantI also tried the quad solution ( http://developer.tobii.com/community/forums/topic/gui-button-and-gaze-aware/ )
but in my case it is also shifted .. ( the quad is detected where it is not and is not detected where it is ) 😮 what am i doing wrong?
Thank you04/05/2017 at 11:39 #6793tiblopParticipantAfter some investigation, it turns out that if i run the “simpleGazeSelection” demo, the pink dots are also shifted compare to the gazeTrace. If i have my two screens it is shifted to the right, if i have only one screen it is shifted to the left ( A LOT shifted, you can see in the picture: https://ibb.co/cqkeRQ ) ..
I must inform that everything work fine out of unity ( if i test calibration it is fine ) I tried to recalibrate each time i change screen configuration but it didnt resolve the issue. I also tried to set the DPI to 100% as suggested here :
but it also didn’t solve the problem .Any idea?
Thank you04/05/2017 at 16:04 #6797tiblopParticipantSo actualy “disable display scaling on high DPI settings” fixed the gaze aware issue. The quad solution works fine now.
However, the gaze position is still shifted. If I display gazePlotter ( as in the demoscene ) and gazePosition (represented by a sphere) at the same time. They are not at the same location ?!
I would much rather use gazePosition, how can I solve this problem?
Thank you
- AuthorPosts
- You must be logged in to reply to this topic.