Good day! Found a bug in the zed-unity code that was causing the right camera to not show up on the display when using OpenXR.
-transform.localPosition assign attempt for ‘Frame’ is not valid. Input localPosition is { Infinity, -Infinity, 0.150000 }.
This problem is written here: Zed-unity plugin - stereo rendering - AR passthrough for Quest 3
Grok 3 suggested me to make a fix in this code:
float plane_distance = 0.15f;
Vector4 opticalCenters = zedCamera.ComputeOpticalCenterOffsets(plane_distance);
if (side == 0) // Left eye
canvas.transform.localPosition = new Vector3(opticalCenters.x, -1.0f * opticalCenters.y, plane_distance);
else if (side == 1) // Right eye
canvas.transform.transform.localPosition = new Vector3(opticalCenters.z, -1.0f * opticalCenters.w, plane_distance);
This code replaced with:
Vector3 newPosition;
if (side == 0)
{
newPosition = new Vector3(opticalCenters.x, -1.0f * opticalCenters.y, plane_distance);
}
else if (side == 1)
{
// Check for infinite values
float rightX = float.IsInfinity(opticalCenters.z) ||| float.IsNaN(opticalCenters.z) ? 0 : opticalCenters.z;
float rightY = float.IsInfinity(opticalCenters.w) || float.IsNaN(opticalCenters.w) ? 0 : opticalCenters.w;
newPosition = new Vector3(rightX, -1.0f * rightY, plane_distance);
}
else
{
newPosition = Vector3.zero; // Just in case
}
canvas.transform.localPosition = newPosition;
After fixing the code, the right eye displays correctly. But now I have a new problem: the image from the camera in oculus is stretched and the body and objects are seen much lar
ger than they really are. Is there any way to tweak the resolution settings for a more realistic video view in the headset? What should I do to make the image not so stretched horizontally?