From 02510790c38b66f3d4b6cf05f24da2118493f33f Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Sun, 21 Jun 2015 17:16:30 -0700 Subject: [PATCH] Fixing projection during star rendering --- interface/src/starfield/renderer/Renderer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interface/src/starfield/renderer/Renderer.cpp b/interface/src/starfield/renderer/Renderer.cpp index 1ebb4245e2..5fc858d952 100644 --- a/interface/src/starfield/renderer/Renderer.cpp +++ b/interface/src/starfield/renderer/Renderer.cpp @@ -11,6 +11,7 @@ // #include "starfield/renderer/Renderer.h" +#include "Application.h" using namespace starfield; @@ -52,6 +53,10 @@ void Renderer::render(float perspective, float aspect, mat4 const& orientation, matrix[3][1] = 0.0f; matrix[3][2] = 0.0f; + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadMatrixf(glm::value_ptr(qApp->getDisplayViewFrustum()->getProjection())); + glMatrixMode(GL_MODELVIEW); // extract local z vector vec3 ahead = vec3(matrix[2]); @@ -74,6 +79,10 @@ void Renderer::render(float perspective, float aspect, mat4 const& orientation, floodFill(cursor, TileSelection(*this, _tileArray, _tileArray + _tiling.getTileCount(), (TileSelection::Cursor*) _batchCountArray)); this->glBatch(glm::value_ptr(matrix), prepareBatch((unsigned*) _batchOffs, _outIndexPos), alpha); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } // renderer construction