Perspective/Matrices issues
Hello, I'm having some real trouble getting the perspective right.
First of all, looking straight ahead, I am looking like 45 degrees down in the scene. No idea why.
Secondly, the perspective is all fucked. as I look around the world distorts like crazy. It seems to be sorta treating each eye like 16x9, when they should be 8x9 if you get what i mean.
Third, Is there a way to get raw degrees of FOV for each eye? the value I get is 1.4 something, i dont understand what that is.
Fourth: How do I get rid of that stupid health and safety message?
And I can swap the value from this with this:
And I get the same result.
This is the function I use, and for some reason, I get this horrid skewing of the scene.
My render function:
This image is me looking STRAIGHT AHEAD, and for some reason I'm looking 45 degrees downward. If i take out all of the translations, this is still the case.

I don't even care about how the oculus vr mode fucks up my model, I just want the matrices to work, but I can't figure out what's wrong exactly.
Any help is appreciated
First of all, looking straight ahead, I am looking like 45 degrees down in the scene. No idea why.
Secondly, the perspective is all fucked. as I look around the world distorts like crazy. It seems to be sorta treating each eye like 16x9, when they should be 8x9 if you get what i mean.
Third, Is there a way to get raw degrees of FOV for each eye? the value I get is 1.4 something, i dont understand what that is.
Fourth: How do I get rid of that stupid health and safety message?
MATRIX4f VRDATA::GetEyeProjMatrix(const int& eyeIndex)
{
ovrEyeType eye = hmd->EyeRenderOrder[eyeIndex];
Matrix4f matr = ovrMatrix4f_Projection(hmd->DefaultEyeFov[eyeIndex], 0.01f, 10000.0f, 1);
return ConvertOVRMatrix(matr);
}
And I can swap the value from this with this:
m_pipeline.Perspective(100.0f, (float)(g_graphicsManager->GetWidth() / 2.0f) / (float)g_graphicsManager->GetHeight(), 0.01f, 1000.0f);
And I get the same result.
This is the function I use, and for some reason, I get this horrid skewing of the scene.
My render function:
ovrPosef eyeRenderPose[2];
for (int i = 0; i < 2; i++)
{
ovrEyeType eye = g_graphicsManager->m_vrData->hmd->EyeRenderOrder[i];
glViewport(eye == ovrEye_Left ? 0 : g_graphicsManager->GetFBWidth() / 2,
0,
g_graphicsManager->GetFBWidth() / 2,
g_graphicsManager->GetFBHeight());
m_pipeline.LoadIdentity();
m_pipeline.MatrixMode(PROJECTION_MATRIX);
//m_pipeline.Perspective(g_graphicsManager->m_vrData->GetEyeProjMatrix(i));
m_pipeline.Perspective(100.0f, (float)(g_graphicsManager->GetWidth() / 2.0f) / (float)g_graphicsManager->GetHeight(), 0.01f, 1000.0f);
eyeRenderPose[eye] = ovrHmd_GetEyePose(g_graphicsManager->m_vrData->hmd, eye);
m_pipeline.MatrixMode(VIEW_MATRIX);
m_pipeline.AddMatrix(g_graphicsManager->m_vrData->GetRotationMatrix(i));
m_pipeline.Translate(g_graphicsManager->m_vrData->eyeRenderDesc[eye].ViewAdjust.x,
g_graphicsManager->m_vrData->eyeRenderDesc[eye].ViewAdjust.y,
g_graphicsManager->m_vrData->eyeRenderDesc[eye].ViewAdjust.z);
m_pipeline.Translate(-eyeRenderPose[eye].Position.x,
-eyeRenderPose[eye].Position.y,
-eyeRenderPose[eye].Position.z);
m_pipeline.Translate(0, -ovrHmd_GetFloat(g_graphicsManager->m_vrData->hmd, OVR_KEY_EYE_HEIGHT, 1.65), 0);
RenderModels();
}
g_graphicsManager->UnbindFramebuffer();
//glViewport(0, 0, g_graphicsManager->GetWidth(), g_graphicsManager->GetHeight());
ovrHmd_EndFrame(g_graphicsManager->m_vrData->hmd, eyeRenderPose, &g_graphicsManager->m_vrData->eyeTexture[0].Texture);
assert(glGetError() == GL_NO_ERROR);
This image is me looking STRAIGHT AHEAD, and for some reason I'm looking 45 degrees downward. If i take out all of the translations, this is still the case.

I don't even care about how the oculus vr mode fucks up my model, I just want the matrices to work, but I can't figure out what's wrong exactly.
Any help is appreciated
