Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
manyu360's avatar
manyu360
Explorer
10 years ago

Use Oculus facing the sky

I would like to use the oculus facing the sky. Its more like relaxation project than guns blazing action Game.

The player needs to lie down and use oculus as per our project. So oculus calibrates to real world space and shows the player the sky in-game but we want the player to see the game world in that is the forward direction not up direction when the game starts. But we can't seem to change oculus initial orientation through the unity package. We didn't have the problem with older sdk only the sdk v 0.5.0.1. Uploading image for better understanding.

We tried changing the tracking space but it acts in an odd fashion.
Oculus_facing_Sky.jpg

5 Replies

Replies have been turned off for this discussion
  • Anonymous's avatar
    Anonymous
    Can I make a suggestion to Oculus/Samsung? Just as there is a set horizontal angle function it would be great if there were a set vertical angle function (along with a reset to normal). People in recliners/beds etc will want to use VR content (movies, etc) and shouldn't have to rely on each app to put in special code to do so.
  • We are not using the 3rd person controller we are simply using the OVRCameraRig. Is there no solution to recenter the camera positions not just horizontally but vertically as well ?
  • No, you don't have to use the 3rd Person Controller.

    If you have your own parent node, it will take the rotation into account.
  • I tried this here are a list of ways i tried it

    1. Applied the script you mentioned to the parent of the CameraRig didnt work as the centerEyeAnchors rotations were independent of the parent.

    2. Added code onto the fixed update only the rotation part on The Tracking Space i.e.
    Quaternion combinedRotation = transform.rotation;
    combinedRotation *= Quaternion.Euler(90, 0, 0);
    then applied : transform.rotation=combinedRotation
    the 90 degree to account for the sleeping position
    Didnt work as everything flickered as there was a conflict between the Update of the oculus Cameras and the Tracking Space

    3. Added code to the Tracking Space Start function
    Quaternion combinedRotation = transform.rotation;
    combinedRotation *= Quaternion.Euler(90, 0, 0);
    transform.rotation=combinedRotation
    then added ResetOrientation();
    public void ResetOrientation()
    {
    Vector3 euler = transform.rotation.eulerAngles;
    euler.y = 0;
    transform.rotation = Quaternion.Euler(euler);

    }

    this is same as the OVRPlayerController

    This worked that it reset the rotation of the X-axis and i was able to lie down and play the game if the Y-axis was correct which means that my bed had to face a certain direction for it to work

    -> When sleeping in North direction and South direction(yeah i used a compass ;) )
    Lets say i look up see the Game world then look straight i see the sky PERFECT(oculus real world rotation along x-axis and so is the game world rotation)

    ->When sleeping in West direction and East direction
    I look Up see the game world then when look straight i dont see the sky only the game world i.e. oculus rotates on the Y-axis and not the X-axis though the real world rotation is on the x-axis(how to say this rotates like your head is bent 90 to the right and rotated about the vertical axis )

    In short the interaction is weird