Commit 89be3271 authored by jean-pierre charras's avatar jean-pierre charras

3D viewer: fix 3D grid artifact ( bug 1293873 )

parent b4369243
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
// Imported function: // Imported function:
extern void CheckGLError(); extern void CheckGLError();
/* returns true if aLayer should be displayed, false otherwise /* Helper function
* returns true if aLayer should be displayed, false otherwise
*/ */
static bool Is3DLayerEnabled( LAYER_NUM aLayer ); static bool Is3DLayerEnabled( LAYER_NUM aLayer );
...@@ -144,7 +145,8 @@ void EDA_3D_CANVAS::Redraw() ...@@ -144,7 +145,8 @@ void EDA_3D_CANVAS::Redraw()
-g_Parm_3D_Visu.m_BoardPos.y * g_Parm_3D_Visu.m_BiuTo3Dunits, -g_Parm_3D_Visu.m_BoardPos.y * g_Parm_3D_Visu.m_BiuTo3Dunits,
0.0F ); 0.0F );
// draw all objects in lists
// transparent objects should be drawn after opaque objects
glCallList( m_glLists[GL_ID_BOARD] ); glCallList( m_glLists[GL_ID_BOARD] );
glCallList( m_glLists[GL_ID_TECH_LAYERS] ); glCallList( m_glLists[GL_ID_TECH_LAYERS] );
...@@ -156,21 +158,23 @@ void EDA_3D_CANVAS::Redraw() ...@@ -156,21 +158,23 @@ void EDA_3D_CANVAS::Redraw()
glCallList( m_glLists[GL_ID_AUX_LAYERS] ); glCallList( m_glLists[GL_ID_AUX_LAYERS] );
} }
if( g_Parm_3D_Visu.GetFlag( FL_GRID ) && m_glLists[GL_ID_GRID] )
glCallList( m_glLists[GL_ID_GRID] );
if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) ) if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) )
{ {
if( ! m_glLists[GL_ID_3DSHAPES_SOLID] ) if( ! m_glLists[GL_ID_3DSHAPES_SOLID] )
CreateDrawGL_List(); CreateDrawGL_List();
glCallList( m_glLists[GL_ID_3DSHAPES_SOLID] ); glCallList( m_glLists[GL_ID_3DSHAPES_SOLID] );
}
// This list must be drawn last, because it contains the // Grid uses transparency: draw it after all objects
// transparent gl objects, which should be drawn after all if( g_Parm_3D_Visu.GetFlag( FL_GRID ) && m_glLists[GL_ID_GRID] )
// non tyransparent objects glCallList( m_glLists[GL_ID_GRID] );
// This list must be drawn last, because it contains the
// transparent gl objects, which should be drawn after all
// non transparent objects
if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) && m_glLists[GL_ID_3DSHAPES_TRANSP] )
glCallList( m_glLists[GL_ID_3DSHAPES_TRANSP] ); glCallList( m_glLists[GL_ID_3DSHAPES_TRANSP] );
}
SwapBuffers(); SwapBuffers();
} }
...@@ -913,8 +917,8 @@ void EDA_3D_CANVAS::Draw3DGrid( double aGriSizeMM ) ...@@ -913,8 +917,8 @@ void EDA_3D_CANVAS::Draw3DGrid( double aGriSizeMM )
double zpos = 0.0; double zpos = 0.0;
EDA_COLOR_T gridcolor = DARKGRAY; // Color of grid lines EDA_COLOR_T gridcolor = DARKGRAY; // Color of grid lines
EDA_COLOR_T gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines EDA_COLOR_T gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines
double scale = g_Parm_3D_Visu.m_BiuTo3Dunits; const double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;
double transparency = 0.4; const double transparency = 0.3;
glNormal3f( 0.0, 0.0, 1.0 ); glNormal3f( 0.0, 0.0, 1.0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment