View transform fix

This commit is contained in:
Jack Andersen 2016-02-16 11:05:51 -10:00
parent 721929e4d0
commit c51b1face6
3 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ class ViewManager : public Specter::IViewManager
{
m_vm.m_partGen->Update(1.0 / 60.0);
pshag::CGraphics::SetModelMatrix(Zeus::CTransform::Identity());
pshag::CGraphics::SetViewPointMatrix(Zeus::CTransform::Identity() + Zeus::CVector3f(0.f, 10.f, 0.f));
pshag::CGraphics::SetViewPointMatrix(Zeus::CTransform::Identity() + Zeus::CVector3f(0.f, -10.f, 0.f));
boo::SWindowRect windowRect = m_vm.m_mainWindow->getWindowFrame();
float aspect = windowRect.size[0] / float(windowRect.size[1]);
pshag::CGraphics::SetPerspective(55.0, aspect, 0.001f, 1000.f);

View File

@ -65,8 +65,8 @@ void CGraphics::SetViewPointMatrix(const Zeus::CTransform& xf)
{
g_ViewMatrix = xf;
g_ViewPoint = xf.m_origin;
g_GXViewPointMatrix.m_basis = g_ViewMatrix.m_basis.transposed();
g_GXViewPointMatrix.m_origin = -g_ViewPoint;
Zeus::CMatrix3f tmp(xf.m_basis[0], xf.m_basis[2], -xf.m_basis[1]);
g_GXViewPointMatrix = Zeus::CTransform(tmp.transposed());
SetViewMatrix();
}

View File

@ -29,7 +29,7 @@ static const char* VS_GLSL_TEX =
" vtf.color = colorIn * moduColor;\n"
" vtf.uv = uvsIn[gl_VertexID].xy;\n"
" gl_Position = mvp * posIn[gl_VertexID];\n"
" gl_Position = vec4(posIn[gl_VertexID].x, posIn[gl_VertexID].z, 0.0, 1.0);\n"
" //gl_Position = vec4(posIn[gl_VertexID].x, posIn[gl_VertexID].z, 0.0, 1.0);\n"
"}\n";
static const char* FS_GLSL_TEX =