philpax / wgpu-openxr-example

a barebones example of how to integrate OpenXR with wgpu (Vulkan-only)
MIT License
49 stars 9 forks source link

Figure out what's going on with the coordinate space #5

Open philpax opened 1 year ago

philpax commented 1 year ago

I've bodged the transform from OpenXR space to wgpu space:

let xr_rotation = {
    let o = pose.orientation;
    Quat::from_rotation_x(180.0f32.to_radians()) * glam::quat(o.w, o.z, o.y, o.x)
};
let xr_translation = glam::vec3(-pose.position.x, pose.position.y, -pose.position.z);

This is very much trial and error and not based in any kind of well-understood transformation. Getting to the bottom of this would be ideal.