Images not aligned in Varjo XR3 using OpenXr

After I get the fov tangents from XrLocateViews, I calculate their arctangent and convert them to degrees ( RAD_2_DEG * atanf(fov) ) so I can pass it to the function used in the engine, which takes in 4 floats (top, bottom, right, left) in degrees.

The image looks alright on the screen, but when I put the headset on it is clear that there is a problem with the image generated. I do not believe there is a problem with my setup of OpenXR, the same fov tangents were also generated in the sdk provided by Varjo. This is why I believe the problem is with the calculations I did.

Is there any clear problem with the way I calculated the tangents I passed to the function?

UPDATE: here are the tangents generated by XrLocateViews:

{ left: -1.005227, right: 0.617792, bottom: -0.840093, top: 0.677231 }
{ left: -0.621404, right: 0.998676, bottom: -0.839083, top: 0.676443 }

The values in an XrFovf are already angles, so you shouldn’t need to take the arctangents of them.

2 Likes

In the spec

The angles must be specified in radians, and must be between -π/2 and π/2 exclusively.

Thank you so much! That was the solution. I feel so dumb right now, I have no idea why I haven’t tried this sooner.