Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Oculus Rift get orientation

Discussion in 'AR/VR (XR) Discussion' started by bdscantraxx, Jan 7, 2015.

  1. bdscantraxx

    bdscantraxx

    Joined:
    Jan 7, 2015
    Posts:
    3
    Hi there,
    i am working on a project where i have to control two servos. The position of these two servos depends on the orientation of the head. But i have no idea where i can get this information. I've tried the following:
    Code (CSharp):
    1.         OVRPose leftEye = OVRManager.display.GetEyePose(OVREye.Left);
    2.         OVRPose rightEye = OVRManager.display.GetEyePose(OVREye.Right);
    3.         print (rightEye.orientation.eulerAngles.x);
    But i get only zeros as x, y and z orientation.
    I am using the Oculus Rift Unity Integration v 0.4.4. The Oculus Demo works on my pc.

    Thanks a lot for help

    David
     
  2. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    I just grab the rotation directly from the center camera in the Oculus camera prefab, found it the simplest way : )
     
  3. bdscantraxx

    bdscantraxx

    Joined:
    Jan 7, 2015
    Posts:
    3
    Thanks for your answer :). This is a good idea. But it don't work. The rotation in in x and z direction are permanently 0. The y Axis has another value, but this value don't move. The only value that move is the position of the y axis. Any idea why this happen? What I've done:
    Create a project, dropped the OvrController into my scene and than I hit start. Is there something I have to enable?

    Thanks

    David
     
  4. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    No, should just work. I have no issues at all with it...
     
  5. alfredoCarsi

    alfredoCarsi

    Joined:
    Aug 7, 2015
    Posts:
    1
    did you figure out how to obtain the orientation data?