toshi Posted March 30, 2023 Share Posted March 30, 2023 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 More sharing options...
MarcusN Posted March 30, 2023 Share Posted March 30, 2023 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 Link to comment Share on other sites More sharing options...
toshi Posted April 6, 2023 Author Share Posted April 6, 2023 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now