This commit is contained in:
Ivan
2022-04-15 15:50:35 +03:00
parent 1e079547ce
commit 617e16f8b4

View File

@@ -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);