Merge pull request #1984 from maxGimeno/Polyhedron_demo-Fix_offset-GF

Fix offset bug in polyhedron_demo
This commit is contained in:
Laurent Rineau 2017-03-29 11:49:00 +02:00 committed by GitHub
commit ae6b2f2525
1 changed files with 4 additions and 5 deletions

View File

@ -838,16 +838,15 @@ void MainWindow::updateViewerBBox()
const double ymax = bbox.ymax();
const double zmax = bbox.zmax();
//qDebug() << QString("Bounding box: (%1, %2, %3) - (%4, %5, %6)\n")
//.arg(xmin).arg(ymin).arg(zmin).arg(xmax).arg(ymax).arg(zmax);
qglviewer::Vec
vec_min(xmin, ymin, zmin),
vec_max(xmax, ymax, zmax),
bbox_center((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2);
qglviewer::Vec offset(0,0,0);
double l_dist = (std::max)((std::abs)(bbox_center.x + viewer->offset().x),
(std::max)((std::abs)(bbox_center.y + viewer->offset().y),
(std::abs)(bbox_center.z + viewer->offset().z)));
double l_dist = (std::max)((std::abs)(bbox_center.x - viewer->offset().x),
(std::max)((std::abs)(bbox_center.y - viewer->offset().y),
(std::abs)(bbox_center.z - viewer->offset().z)));
if((std::log2)(l_dist) > 13.0 )
for(int i=0; i<3; ++i)
{