mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
Fixing projection during star rendering
This commit is contained in:
parent
4ccdc78866
commit
02510790c3
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue