- Home /
Question by
unity_14QhPqsvggTkdg · Oct 30, 2019 at 11:02 AM ·
c#unity 4
Mapping from External to Unity World Coordinates for eye tracking
Hello, I got 3D coordinates from a tobii glasses Pro 2 indicating the gaze position, and i need to track the eye gaze position and represent it to the unity wolrd by a sphere or a cube that should follow the gaze position. i calculated the new position of the object this way but it doesn't seem to work. the object goes in the right direction but not to the exact point where i'm looking. Here what I wrote :
Vector3 newPosition = new Vector3(-position[0] + camPosition.x, position[1] + camPosition.y, position[2] + camPosition.z);
transform.position = Vector3.SmoothDamp(transform.position, newPosition, ref velocity, smoothTime);
I'm not sure about adding the camPosition because I don't really understant the depth component in Unity. Can anyone help me with this issue?
Comment