-
Posts
12 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Blogs
Events
Store
Downloads
Posts posted by AdamStreck
-
-
I did not figure it out. Would you please post details @Av ?
I know where the issue lies, though, it's a difference between the view provided by "Left Eye" vs the full image rendered to the headset.
I have made a simple example, where the camera coordinates of an object are printed directly on screen. The project is attached (EyeTrackingIssue.zip), but the full code is the following:
using UnityEngine; using UnityEngine.UI; using UnityEngine.XR; public class DisplaySSCoordinates : MonoBehaviour { public Transform debugSphere; public Text displayText; public Camera vrCamera; private void Update() { var coords = vrCamera.WorldToScreenPoint(debugSphere.position, Camera.MonoOrStereoscopicEye.Left); var eyeTextureSize = new Vector2(XRSettings.eyeTextureWidth, XRSettings.eyeTextureHeight); var units = new Vector2(coords.x / eyeTextureSize.x, coords.y / eyeTextureSize.y); displayText.text = $"({units.x:F2},{units.y:F2})"; } }
You can see that in the bottom-left and top-right corners, the coordinates are not what I would expect. For the center it is correct:
However when I switch from the "LeftEye" to "OcclusionMesh", the coordinates are correct:
This is obviously not SRanipal issue only, probably will also happen for other EyeTracking systems, however I think this is the prescribed way of getting the screen-space position (it's a while I'm not sure, I'm happy for a different workflow).
I noticed that the error changes with the aspect ratio, which makes sense as the screen-crop of the "LeftEye" changes too.
I'd need to obtain the information how the "EyeTexture" is cropped into the game view to calculate the position correctly. Any recommendations?
-
I'm trying to display a UI element in the position of the gaze collision. I found out that just using:
Camera.main.WorldToScreenPoint(collision.position, Camera.MonoOrStereoscopicEye.Left);
does not fully work for the "LeftEye" display - there seems to be some screen-cropping going on (about 15% on each side).
Does anybody have a way how to reliably obtain a screenpoint from world point in SteamVR in Unity please? -
Getting Screen Position of the Gaze in Unity
in VIVE Eye and Facial Tracking SDK
Posted
Update - Unity has reproduced the issue on their end and flagged a bug: https://issuetracker.unity3d.com/issues/xr-sdk-cameraworldtoscreenpoint-returns-offset-coordinates