Annabell Posted November 8, 2019 Share Posted November 8, 2019 I want to get the position of the headset in order to decide if someone nodded or shaked his/her head. Anyone has any idea how I get the position data/values of the headset? Do I need any specific gameObjects? Link to comment Share on other sites More sharing options...
HackPerception Posted November 8, 2019 Share Posted November 8, 2019 @Annabell What's your development environment (Unity/Unreal)? On the OpenVR SDK side - you can query the pose via the tracking functions within IVRSystem: https://github.com/ValveSoftware/openvr/wiki/IVRSystem_Overview Link to comment Share on other sites More sharing options...
Annabell Posted November 10, 2019 Author Share Posted November 10, 2019 I am using Unity @VibrantNebula Link to comment Share on other sites More sharing options...
Annabell Posted November 11, 2019 Author Share Posted November 11, 2019 Within Unity I can only download SteamVR Plugin and not OpenVR Plugin. On top of that the IVRSystem seems to be in C++, but within Unity you usually use C# @Corvus Link to comment Share on other sites More sharing options...
Corvus Posted November 11, 2019 Share Posted November 11, 2019 @Annabell The HMD position is tracked with the Unity Camera so you can use that to detect head rotation (nodding/shaking). Link to comment Share on other sites More sharing options...
Annabell Posted December 9, 2019 Author Share Posted December 9, 2019 Thanks got it Link to comment Share on other sites More sharing options...
Asish Posted April 9, 2021 Share Posted April 9, 2021 @Annabell Did you get head rotation? If so, how did you detect head rotation? Link to comment Share on other sites More sharing options...
HackPerception Posted April 13, 2021 Share Posted April 13, 2021 @Asish Depends on your setup, your engine, etc... Most Unity devs would take their VR camera rig and then script against it to create variables they can then apply conversions on to get an output of an quaternon, a euler angle, or a rotation matrix. It really depends on what your project looks like and how much error is allowable since quaternon or Euler angles will introduce conversion error, especially Euler conversions. Note that it's particularly a rabbit hole in Unity that can be headache inducing. Here are some posts which may help lead you down a working approaching. Link to comment Share on other sites More sharing options...
Asish Posted August 14, 2021 Share Posted August 14, 2021 Hello @Corvus @HackPerception I'm trying to calculate distance between gaze_origin(provided by API) and the target object using following code but the units are not same for these two points. So, how to get same type of coordinate system? var d = GameObject.Find("CubeObject").transform.position; var combine_gaze = eyeData.verbose_data.combined.eye_data.gaze_origin_mm; float dist = Vector3.Distance(d, combine_gaze); Thanks in advance 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