• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Darth-Zoddo · Aug 14, 2017 at 09:19 AM · cameraphysicsvroculusoculusrift

Disabling VR Camera rotation creates ''cinema'' effect in VR device

I am trying to get VR working in Unity together with a Mocap suit. The problem is when I make the camera a child of the head of my Mocap suit (character) within Unity.

The problem is that the OVRCameraRIG is rotating around it's own axis instead of that of it's parent (mocap suit head). When I disable tracking via this script: using System.Collections; using System.Collections.Generic; using UnityEngine;

public class EnableDisableOVRPosAndRotTracking : MonoBehaviour {

 public bool useOVRTracking = false;

 // Use this for initialization
 void Start() {
     OVRPlugin.rotation = useOVRTracking;
     OVRPlugin.position = useOVRTracking;
 }

 // Update is called once per frame
 void Update() {

 }

}

The tracking is disabled, which is what i want because i only want the camera to rotate with the head and not by itself. Because if it does rotate by itself it creates rotation problems and gives you a sort of drunken effect which makes you sick IRL.

The problem with disabling it is that in the Oculus CV1, I see one big screen that renders my camera and everything around it is completely black. It makes you feel as if you're in a cinema....

What did I do wrong and how do I fix this issue.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Darth-Zoddo · Aug 15, 2017 at 07:26 AM

I tried fixing the problem with multiple scripts etc. Almost everything i tried resulted in the parent of the camera not moving, or the camera not moving when moving the parent. Or it gave me the result with the "Cinema" effect etc.

I came a cross a thread on the unity forum of 2016 where an Oculus dev started to respond to. The thread send me to another thread etc. Until i came across this one: https://forums.oculus.com/vip/discussion/comment/446956/#Comment_446956

I added this script:

using UnityEngine; using System.Collections;

public class FakeTracking : MonoBehaviour { public OVRPose centerEyePose = OVRPose.identity; public OVRPose leftEyePose = OVRPose.identity; public OVRPose rightEyePose = OVRPose.identity; public OVRPose leftHandPose = OVRPose.identity; public OVRPose rightHandPose = OVRPose.identity; public OVRPose trackerPose = OVRPose.identity;

 void Awake()
 {
     OVRCameraRig rig = GameObject.FindObjectOfType<OVRCameraRig>();

     if (rig != null)
         rig.UpdatedAnchors += OnUpdatedAnchors;
 }

 void OnUpdatedAnchors(OVRCameraRig rig)
 {
     if (!enabled)
         return;

     //This doesn't work because VR camera poses are read-only.
     //rig.centerEyeAnchor.FromOVRPose(OVRPose.identity);

     //Instead, invert out the current pose and multiply in the desired pose.
     OVRPose pose = rig.centerEyeAnchor.ToOVRPose(true).Inverse();
     pose = centerEyePose * pose;
     rig.trackingSpace.FromOVRPose(pose, true);

     //OVRPose referenceFrame = pose.Inverse();

     //The rest of the nodes are updated by OVRCameraRig, not Unity, so they're easy.
     rig.leftEyeAnchor.FromOVRPose(leftEyePose);
     rig.rightEyeAnchor.FromOVRPose(rightEyePose);
     rig.leftHandAnchor.FromOVRPose(leftHandPose);
     rig.rightHandAnchor.FromOVRPose(rightHandPose);
     rig.trackerAnchor.FromOVRPose(trackerPose);
 }

}

to my OVRCameraRIG without changing any variables in the hierarchy, and it fixed my problem. This is ideal for multiplayer Mocap, which is what i'm trying to do now. It works with Unity 5.6.3f1

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Darth-Zoddo · Aug 16, 2017 at 12:05 PM 0
Share

I noticed that there's still a tiny bit of movement when moving the headset, this might cause motion sickness.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

164 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Oculus "PerEyeCameras" showing blackscreen only when LWRP or URP is enabled 0 Answers

Is it possible to override the "Cannot set field of view on camera with name 'screenCamera' while VR is enabled." limitation? 1 Answer

how to make Oculus Touch door opening 0 Answers

,Does anyone know how to implement the touch controllers on a build made for Samsung Gear? 0 Answers

How do you detect the Oculus remote without using OVRInput? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges