I've been making great strides with MonoGame and I've recently started my plunge into VR via the OpenVR. I'm dangerous close to it working 100% thanks to examples from Jjagg. However, it's rendering to the headset Upside down and reversed! While I've not found anything obviously wrong my 'assumption' was it's something to do with my matrix or the conversion of it. I'm using these functions to convert the OpenVR matrix for rendering:
public static Matrix ToMg(this HmdMatrix34_t mat) {
var m = new Matrix(
mat.m0, mat.m4, mat.m8, 0.0f,
mat.m1, mat.m5, mat.m9, 0.0f,
mat.m2, mat.m6, mat.m10, 0.0f,
mat.m3, mat.m7, mat.m11, 1.0f);
return m;
}
public static Matrix ToMg(this HmdMatrix44_t mat) {
var m = new Matrix(
mat.m0, mat.m4, mat.m8, mat.m12,
mat.m1, mat.m5, mat.m9, mat.m13,
mat.m2, mat.m6, mat.m10, mat.m14,
mat.m3, mat.m7, mat.m11, mat.m15);
return m;
}
I know that OpenVR returns Left Handed matrix but I admit I'm lost on how that converts.
Anyone run into this or have some insight? Thanks gang!
David