EgtGraphics :

- Cubetto
- Assi
- Griglia
- Zoom.
This commit is contained in:
Riccardo Elitropi
2023-06-01 13:03:24 +02:00
parent 3c1e9e8790
commit 147964cf6a
10 changed files with 1303 additions and 744 deletions
+49 -12
View File
@@ -54,6 +54,15 @@ Scene::Scene( void)
m_hRC = nullptr ;
m_nOglVer = 0 ;
m_bNewWay = false ;
// Colors
m_cColX = Color( 255, 0, 0, 1) ;
m_cColXm = Color( 167, 27, 11, 1) ;
m_cColY = Color( 0, 255, 0, 1) ;
m_cColYm = Color( 36, 163, 25, 1) ;
m_cColZ = Color( 0, 0, 255, 1) ;
m_cColZm = Color( 36, 17, 120, 1) ;
m_cColEdge = Color( 200, 200, 200, 1) ;
m_cColCorner = Color( 200, 200, 200, 1) ;
// Camera e viewport
m_ptCenter = ORIG ;
SetCamera( 0, 0, 0) ;
@@ -98,16 +107,30 @@ Scene::Scene( void)
SetExtension( BBox3d( -MIN_EXTENSION, -MIN_EXTENSION, -MIN_EXTENSION,
MIN_EXTENSION, MIN_EXTENSION, MIN_EXTENSION)) ;
// Grid
m_bShowGrid = false ;
m_bShowFrame = false ;
m_dSnapStep = 1 ;
m_bShowGrid = false ;
m_bShowFrame = false ;
m_dSnapStep = 1 ;
m_nMinLineSstep = 10 ;
m_nMajLineSstep = 100 ;
m_nExtSstep = 500 ;
m_colMinLine.Set( 160, 160, 160) ;
m_colMajLine.Set( 160, 160, 160) ;
// Global Frame
m_bShowGlobFrame = false ;
m_nExtSstep = 500 ;
m_colMinLine.Set( 160, 160, 160) ;
m_colMajLine.Set( 160, 160, 160) ;
m_dGridWidth = 1000 ;
m_dGridHeight = 1000 ;
m_nGridFrame_Flag = 1 ;
// Axis Frame
m_bShowGlobFrame = true ;
m_nAxisFrame_Flag = 3 ;
m_dFrame_DistX = 40.0 ;
m_dFrame_DistY = 120.0 ;
m_dFrameLineL = 25.0;
m_dFrameLineW = 2.0 ;
// Global Cube
m_bShowGlobCube = true ;
m_nCube_Flag = 1 ;
m_dCubeEdge = 55.0 ;
m_dCubeX = 40.0 ;
m_dCubeY = 40.0 ;
// Direct
m_colorGL.Set( 255, 0, 0) ;
m_bGeoLine = false ;
@@ -514,6 +537,7 @@ Scene::CalcClippingPlanesFromExtView( void)
double dExtent = max( ( EXP_COEFF * vtExtent.z), MIN_ZCLIP_EXT) ;
m_dZNear = - ( ptCenter.z + dExtent) ;
m_dZFar = - ( ptCenter.z - dExtent) ;
return true ;
}
@@ -834,15 +858,28 @@ Scene::MyDraw( bool bSwapBF)
// disegno riferimento globale
DrawGlobFrame() ;
// disegno il cubetto
DrawGlobCube();
// aggiungo disegni diretti (con poligoni riempiti)
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL) ;
DrawDirect() ;
// disegno il cubetto
glDisable( GL_LIGHTING) ;
glEnable( GL_DEPTH_TEST) ;
glEnable( GL_POLYGON_OFFSET_FILL) ;
glFrontFace( GL_CCW) ;
glCullFace( GL_BACK) ;
glEnable( GL_CULL_FACE) ;
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL) ;
glPolygonOffset( 0.5, 0.5) ;
DrawGlobCube( true) ; // superifici
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE) ;
glLineWidth( 1) ;
DrawGlobCube( false) ; // linee
glLineWidth( GetLineWidth()) ;
glDisable( GL_CULL_FACE) ;
glDisable( GL_DEPTH_TEST) ;
// aggiorno
glFlush() ;