Forum Discussion
bANGERnomics
6 years agoHonored Guest
OVRCameraRig use per eye cameras changes scale
I'm working on a 3D image/video solution so I'm using the 'per eye camera' option in the OVR Camera Rig in Unity. I noticed that if I toggle this setting on and off, the scale of the world is radical...
phileday
5 years agoMember
Update:
So I've found a fix, in OVRCameraRig.cs I changed
So I've found a fix, in OVRCameraRig.cs I changed
if (!hmdPresent || monoscopic)
{
leftEyeAnchor.localPosition = centerEyeAnchor.localPosition;
rightEyeAnchor.localPosition = centerEyeAnchor.localPosition;
leftEyeAnchor.localRotation = centerEyeAnchor.localRotation;
rightEyeAnchor.localRotation = centerEyeAnchor.localRotation;
}
else
{
leftEyeAnchor.localPosition = centerEyeAnchor.localPosition;
rightEyeAnchor.localPosition = centerEyeAnchor.localPosition;
leftEyeAnchor.localRotation = centerEyeAnchor.localRotation;
rightEyeAnchor.localRotation = centerEyeAnchor.localRotation;
Vector3 leftEyePosition = Vector3.zero;
Vector3 rightEyePosition = Vector3.zero;
Quaternion leftEyeRotation = Quaternion.identity;
Quaternion rightEyeRotation = Quaternion.identity;
if (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.LeftEye, NodeStatePropertyType.Position, OVRPlugin.Node.EyeLeft, OVRPlugin.Step.Render, out leftEyePosition))
leftEyeAnchor.localPosition = leftEyePosition;
if (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.RightEye, NodeStatePropertyType.Position, OVRPlugin.Node.EyeRight, OVRPlugin.Step.Render, out rightEyePosition))
rightEyeAnchor.localPosition = rightEyePosition;
if (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.LeftEye, NodeStatePropertyType.Orientation, OVRPlugin.Node.EyeLeft, OVRPlugin.Step.Render, out leftEyeRotation))
leftEyeAnchor.localRotation = leftEyeRotation;
if (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.RightEye, NodeStatePropertyType.Orientation, OVRPlugin.Node.EyeRight, OVRPlugin.Step.Render, out rightEyeRotation))
rightEyeAnchor.localRotation = rightEyeRotation;
}
}
to this:
to this:
if (!hmdPresent || monoscopic)
{
leftEyeAnchor.localPosition = centerEyeAnchor.localPosition;
rightEyeAnchor.localPosition = centerEyeAnchor.localPosition;
leftEyeAnchor.localRotation = centerEyeAnchor.localRotation;
rightEyeAnchor.localRotation = centerEyeAnchor.localRotation;
}
else
{
leftEyeAnchor.localPosition = centerEyeAnchor.localPosition;
rightEyeAnchor.localPosition = centerEyeAnchor.localPosition;
leftEyeAnchor.localRotation = centerEyeAnchor.localRotation;
rightEyeAnchor.localRotation = centerEyeAnchor.localRotation;
/*
Vector3 leftEyePosition = Vector3.zero;
Vector3 rightEyePosition = Vector3.zero;
Quaternion leftEyeRotation = Quaternion.identity;
Quaternion rightEyeRotation = Quaternion.identity;
if (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.LeftEye, NodeStatePropertyType.Position, OVRPlugin.Node.EyeLeft, OVRPlugin.Step.Render, out leftEyePosition))
leftEyeAnchor.localPosition = leftEyePosition;
if (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.RightEye, NodeStatePropertyType.Position, OVRPlugin.Node.EyeRight, OVRPlugin.Step.Render, out rightEyePosition))
rightEyeAnchor.localPosition = rightEyePosition;
if (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.LeftEye, NodeStatePropertyType.Orientation, OVRPlugin.Node.EyeLeft, OVRPlugin.Step.Render, out leftEyeRotation))
leftEyeAnchor.localRotation = leftEyeRotation;
if (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.RightEye, NodeStatePropertyType.Orientation, OVRPlugin.Node.EyeRight, OVRPlugin.Step.Render, out rightEyeRotation))
rightEyeAnchor.localRotation = rightEyeRotation;
*/
}
}
basically making the left and right camera do this
basically making the left and right camera do this
leftEyeAnchor.localPosition = centerEyeAnchor.localPosition;
rightEyeAnchor.localPosition = centerEyeAnchor.localPosition;
leftEyeAnchor.localRotation = centerEyeAnchor.localRotation;
rightEyeAnchor.localRotation = centerEyeAnchor.localRotation;
seems to work :)
seems to work :)
ruud3DV
4 years agoStart Partner
Thanks a lot for sharing this!!
Ran into the same issue with XR on Oculus Quest (Unity 2020.3.26f1) and setting the TrackedPoseDriver for the LeftEyeAnchor and RightEyeAnchor to use Input Actions 'centerEyePosition' and 'centerEyeRotation' solved this.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 7 months ago
- 8 months ago
- 2 years ago