From 617e16f8b466e9789a14631e60c9058785fe6b41 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 15 Apr 2022 15:50:35 +0300 Subject: [PATCH] v1 --- src/vio.cpp | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/vio.cpp b/src/vio.cpp index bfbf1c2..dc3032a 100644 --- a/src/vio.cpp +++ b/src/vio.cpp @@ -853,37 +853,7 @@ int main(int argc, char** argv) { if (drawTexture) { DrawImageTexture(imageTexture, img_cv_data[2]); } - - // TODO: Can I define it outside of the loop? There's no need I guess to - // redefine the the projection matrix every time - glMatrixMode(GL_PROJECTION); - P.Load(); - - // drawLinesCube pushes the matrices, therefore, I need to define in which - // stack to push that matrices. - glMatrixMode(GL_MODELVIEW); - if (zeroOut){ - xSkew = 0; - ySkew = 0; - zSkew = 0; - } - if (drawCubeBool){ - DrawCube(cubeSize, xSkew, ySkew, zSkew); - } - if (drawLineCubeBool){ - drawLinesCube(xSkew, ySkew, zSkew, cubeSize); - } - // For the 6th sequence mono-kitti - if (showCube1) {drawLinesCube(-5.5, 0.5, -35.0, cubeSize);} - if (showCube2) {drawLinesCube(5.5, 0.5, -40.0, cubeSize);} - if (showCube3) {drawLinesCube(-5.5, 1.0, -95.0, cubeSize);} - if (showCube4) {drawLinesCube(5.5, 1.0, -150.0, cubeSize);} - if (showCube5) {drawLinesCube(16.0, 4.8, -324.5, cubeSize);} - if (showCube6) {drawLinesCube(32.8, 4.8, -324.5, cubeSize);} - if (showCube7) {drawLinesCube(32.5, 4.8, -345.7, cubeSize);} - - ar_3d_camera.Follow((T_w_i * T_i_c).matrix()); -// glClear(GL_DEPTH_BUFFER_BIT); + glClear(GL_DEPTH_BUFFER_BIT); // Ok, so here by the moment we are watching from the camera position and orientation. // Drawing the cube from here might result in drawing the cube in the camera coordinate system. @@ -1305,7 +1275,35 @@ void draw_scene_no_camera(pangolin::View& view) { // axesTic[i] = -axesTic[i]; // } // } + // TODO: Can I define it outside of the loop? There's no need I guess to + // redefine the the projection matrix every time + glMatrixMode(GL_PROJECTION); + P.Load(); + // drawLinesCube pushes the matrices, therefore, I need to define in which + // stack to push that matrices. + glMatrixMode(GL_MODELVIEW); + if (zeroOut){ + xSkew = 0; + ySkew = 0; + zSkew = 0; + } + if (drawCubeBool){ + DrawCube(cubeSize, xSkew, ySkew, zSkew); + } + if (drawLineCubeBool){ + drawLinesCube(xSkew, ySkew, zSkew, cubeSize); + } + // For the 6th sequence mono-kitti + if (showCube1) {drawLinesCube(-5.5, 0.5, -35.0, cubeSize);} + if (showCube2) {drawLinesCube(5.5, 0.5, -40.0, cubeSize);} + if (showCube3) {drawLinesCube(-5.5, 1.0, -95.0, cubeSize);} + if (showCube4) {drawLinesCube(5.5, 1.0, -150.0, cubeSize);} + if (showCube5) {drawLinesCube(16.0, 4.8, -324.5, cubeSize);} + if (showCube6) {drawLinesCube(32.8, 4.8, -324.5, cubeSize);} + if (showCube7) {drawLinesCube(32.5, 4.8, -345.7, cubeSize);} + + ar_3d_camera.Follow((T_w_i * T_i_c).matrix()); // For the 1st sequence mono-kitti // drawLinesCube(0.0, 1.0, -95.0, cubeSize); // drawLinesCube(0.0, 0.5, -35.0, cubeSize);