diff --git a/SceneBasic.cpp b/SceneBasic.cpp index cd42f07..39c060d 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -26,6 +26,7 @@ using namespace std ; //--------------------------- Constants -------------------------------------- static const double MIN_EXTENSION = 50 ; +static const double MIN_W_H = 0.01 ; static const double MIN_ZCLIP_EXT = 5000 ; @@ -413,6 +414,10 @@ Scene::AdjustDimView( double dHalfWidth, double dHalfHeight) } } + // verifico minimo delle dimensioni + dHalfWidth = max( dHalfWidth, MIN_W_H) ; + dHalfHeight = max( dHalfHeight, MIN_W_H) ; + // adatto il rapporto tra le dimensioni calcolate a quello delle dimensioni della vista double dAspect = m_nViewportH / ( double) m_nViewportW ; if ( dAspect * dHalfWidth > dHalfHeight) {