This commit is contained in:
Ivan
2022-04-15 15:14:43 +03:00
parent cb1d2b4e81
commit c44c5a1078

View File

@@ -831,8 +831,8 @@ int main(int argc, char** argv) {
// Appended.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// ar_view.Activate(ar_3d_camera);
ar_view.Activate();
ar_view.Activate(ar_3d_camera);
// ar_view.Activate();
glColor3f(1.0, 1.0, 1.0);
// Get the last image pose. (probably, it's T_w_i
@@ -861,38 +861,6 @@ int main(int argc, char** argv) {
// DrawImageTexture takes also the depth buffer when uploading, so we need clean it.
glClear(GL_DEPTH_BUFFER_BIT);
// 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);
// ar_3d_camera.Follow((T_w_i * T_i_c).matrix());
glPushMatrix();
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);}
glPopMatrix();
// 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.
@@ -1279,7 +1247,7 @@ void draw_scene(pangolin::View& view) {
void draw_scene_no_camera(pangolin::View& view) {
UNUSED(view);
// view.Activate(ar_3d_camera);
view.Activate(ar_3d_camera);
// view.Activate();
// auto T_w_i = vio_T_w_i[show_frame];
// auto T_i_c = calib.T_i_c[0];
@@ -1315,6 +1283,39 @@ void draw_scene_no_camera(pangolin::View& view) {
// }
// }
// 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);
// ar_3d_camera.Follow((T_w_i * T_i_c).matrix());
glPushMatrix();
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);}
glPopMatrix();
// For the 1st sequence mono-kitti
// drawLinesCube(0.0, 1.0, -95.0, cubeSize);
// drawLinesCube(0.0, 0.5, -35.0, cubeSize);