EgtGraphics 1.9l4 :

- fabs sostituito da abs
- aggiunto disegno asse Z+ in riferimento griglia.
This commit is contained in:
Dario Sassi
2018-12-27 11:20:33 +00:00
parent 6347e9d7d4
commit 49e4839934
7 changed files with 17 additions and 13 deletions
+5 -1
View File
@@ -33,7 +33,7 @@ bool
Scene::SetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep)
{
const double MIN_SNAP_STEP = 0.1 ;
m_dSnapStep = std::max( fabs( dSnapStep), MIN_SNAP_STEP) ;
m_dSnapStep = max( abs( dSnapStep), MIN_SNAP_STEP) ;
m_nMinLineSstep = abs( nMinLineSstep) ;
m_nMajLineSstep = abs( nMajLineSstep) ;
m_nExtSstep = abs( nExtSstep) ;
@@ -127,6 +127,10 @@ Scene::DrawGrid( void)
glColor3f( LIME.GetRed(), LIME.GetGreen(), LIME.GetBlue()) ;
glVertex3f( 0, 0, Z_DOWN) ;
glVertex3f( 0, dExt, Z_DOWN) ;
// asse Z+
glColor3f( BLUE.GetRed(), BLUE.GetGreen(), BLUE.GetBlue()) ;
glVertex3f( 0, 0, Z_DOWN) ;
glVertex3f( 0, 0, float( m_nMajLineSstep * m_dSnapStep)) ;
// se richiesta griglia, assi X- e Y-
if ( m_bShowGrid) {
glColor3f( m_colMajLine.GetRed(), m_colMajLine.GetGreen(), m_colMajLine.GetBlue()) ;