Jump to content

How to get gaze direction in degree


Recommended Posts

Hi, I want to get gaze direction in a degree unit. As SRanipal Unity SDK describes, we can get gaze_direction_normalized that is “Vector3 ViveSR.anipal.Eye.SingleEyeData.gaze_direction_normalized” with a description of “The normalized gaze direction of the eye in [0,1]. (right-handed coordinate system)” But I want to get the value in a range of (0–90 or 0–180 degrees or radian), could someone tell me the best solution for converting gaze_direction_normalized into a degree-based value?

Link to comment
Share on other sites

On 3/31/2023 at 2:21 AM, MarcusN said:

Hi @toshi,

If you have another Vector3 that you can compare against, you could use something like Vector3.Angle() to calculate the degrees between your gaze_direction_normalized Vector3 and the other Vector3. The method can be referenced here: https://docs.unity3d.com/ScriptReference/Vector3.Angle.html

Thanks, I'll try it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...