From d5e1bb6631e1a22eaa8dd0ca8ba1db511971af97 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Sun, 22 Jun 2014 21:28:25 -0400 Subject: [PATCH] Make progress on new minimap RTT : it was actually 2 issues. First the new code calls camera->setAspectRatio which resets the matrix; second, we rendered the minimap from the back, and backface culling is now active --- src/tracks/quad_graph.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/tracks/quad_graph.cpp b/src/tracks/quad_graph.cpp index 78e7011f9..6156eadd1 100644 --- a/src/tracks/quad_graph.cpp +++ b/src/tracks/quad_graph.cpp @@ -452,12 +452,12 @@ void QuadGraph::createMesh(bool show_invisible, // Set up the indices for the triangles // (note, afaik with opengl we could use quads directly, but the code // would not be portable to directx anymore). - ind[6*i ] = 4*i; // First triangle: vertex 0, 1, 2 + ind[6*i ] = 4*i+2; // First triangle: vertex 0, 1, 2 ind[6*i+1] = 4*i+1; - ind[6*i+2] = 4*i+2; - ind[6*i+3] = 4*i; // second triangle: vertex 0, 1, 3 + ind[6*i+2] = 4*i; + ind[6*i+3] = 4*i+3; // second triangle: vertex 0, 1, 3 ind[6*i+4] = 4*i+2; - ind[6*i+5] = 4*i+3; + ind[6*i+5] = 4*i; i++; } // for i=1; iisGLSL()) @@ -1057,15 +1055,16 @@ void QuadGraph::makeMiniMap(const core::dimension2du &origdimension, // Adjust Y position by +1 for max, -1 for min - this helps in case that // the maximum Y coordinate is negative (otherwise the minimap is mirrored) // and avoids problems for tracks which have a flat (max Y = min Y) minimap. - camera->setPosition(core::vector3df(center.getX(), bb_min.getY() - 300.0f, center.getZ())); + camera->setPosition(core::vector3df(center.getX(), bb_min.getY() + 1.0f, center.getZ())); //camera->setPosition(core::vector3df(center.getX() - 5.0f, bb_min.getY() - 1 - 5.0f, center.getZ() - 15.0f)); camera->setUpVector(core::vector3df(0, 0, 1)); camera->setTarget(core::vector3df(center.getX(),bb_min.getY()-1,center.getZ())); - camera->setAspectRatio(1.0f); + //camera->setAspectRatio(1.0f); camera->updateAbsolutePosition(); video::ITexture* texture = NULL; FrameBuffer* frame_buffer = NULL; + if (irr_driver->isGLSL()) { frame_buffer = newRttProvider->render(camera, GUIEngine::getLatestDt());