Repository: godot
Issue: OpenXR Stereoscopic matrix not returning the correct projection matrix
Labels: bug,topic:xr

### Tested versions

here's my code:
```python
	# this doesn't work
        var left_eye_proj_matrix = interface.get_projection_for_view(0, image_size.x / image_size.y, 0.05, 4000).inverse()
	var right_eye_proj_matrix = interface.get_projection_for_view(1, image_size.x / image_size.y, 0.05, 4000).inverse()
	
	var left_eye_view_matrix = interface.get_transform_for_view(0, camera.global_transform).inverse()
	var right_eye_view_matrix = interface.get_transform_for_view(1, camera.global_transform).inverse()
	
        # this works as intended
	# var proj_matrix := camera.get_camera_projection().inverse()
	# var cam_to_world_matrix = camera.global_transform
```

i set those matrices to my compute shader and here's how i use it:

```glsl

layout(set = 0, binding = 1, std430) restrict buffer CameraData {
	mat4 leftEyeProjMatrix;
	mat4 leftEyeViewMatrix;
	mat4 rightEyeProjMatrix;
	mat4 rightEyeViewMatrix;
}

...

Ray CreateCameraRay(vec2 uv)
{
	mat4 _CameraToWorld = camera_data.leftEyeViewMatrix;
	mat4 _CameraInverseProjection = camera_data.leftEyeProjMatrix;

    if(uv.x >= 0.5)
    {
        _CameraToWorld = camera_data.rightEyeViewMatrix;
	    _CameraInverseProjection = camera_data.rightEyeProjMatrix;
    }

    vec3 origin = _CameraToWorld[3].xyz;
    
    vec3 direction = (_CameraInverseProjection * vec4(uv, 0.0, 1.0)).xyz;
    direction = (_CameraToWorld * vec4(direction, 0.0)).xyz;
    direction = normalize(direction);
    return CreateRay(origin, direction);
}
```

but if you adapt the shader to work with the normal 

### System information

Godot v4.3.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Laptop GPU (NVIDIA; 32.0.15.6070) - 13th Gen Intel(R) Core(TM) i9-13900H (20 Threads)

### Issue description

so i'm working on a VR project and i wanna use a compute shader to render stuff to the HMD, i have the compute shader rendering correctly to a normal application (windows application, no HMD) and i have a shader to blit the output to the HMD in another project, so far everything was working but when i tried to get the projection matrix and view matrix for each eye, for some reason, the output of the `XRInterface.get_projection_for_view` method returns a weird projection matrix, i know "weird" is not enough to explain the issue, so here i'll list what i found: 

1. eye projection matrices are rotated, if you rotate the HMD over the Z axis the projection matrix rotate over the Y axis and if you rotate over the Y axis then the matrix rotation is weird (here weird is used because there's no way to explain it)
2. projection matrix breaks on rotation, when moving the HMD around i noticed that the projection (or fov) was increasing and decreasing
3. the view projection matrix is not being calculated well, maybe because the reference matrix i'm using to get it

Edit: 
- The view matrix has nothing to do with the issue although i'd love to know if im calculating it correctly, but passing any value (camera.global_transform, XROrigin3D.global_transform and Node3D.global_trasnform) doesn't seems to change the issue in any way so the main problem is the projection matrix calculation

### Steps to reproduce

1. Create new project
2. Enable OpenXR and setup scene (the godot documentation explains it)
3. Enable OpenXR on script (viewport.use_xr)
4. Get eye projection matrix (XRInterface.get_projection_for_view(...))
5. Test the projection matrix on a GLSL shader (i believe that setting the matrix to a normal camera will do the same)

### Minimal reproduction project (MRP)

i dont know what to put here :( sorry