EgtGraphics 2.4h1 :

- in curve composite aggiunti punti intermedi su giunzioni interne tra componenti elementari.
This commit is contained in:
DarioS
2022-08-21 19:26:34 +02:00
parent 68434fba6f
commit 5e317faba6
9 changed files with 101 additions and 4 deletions
+39
View File
@@ -116,6 +116,45 @@ ObjNewGraphics::AddPoint( const Point3d& ptP, bool bAux)
return true ;
}
//----------------------------------------------------------------------------
bool
ObjNewGraphics::AddPoints( const PNTVECTOR& vPnt, bool bAux)
{
if ( m_pScene == nullptr || ! m_pScene->MakeCurrent())
return false ;
// definisco i buffer per la scheda grafica e vi inserisco i nuovi vertici
unsigned int nVaoId ;
glGenVertexArrays( 1, &nVaoId) ;
if ( nVaoId == 0)
return false ;
glBindVertexArray( nVaoId) ;
unsigned int nVboId ;
glGenBuffers( 1, &nVboId) ;
if ( nVboId == 0) {
glBindVertexArray( 0) ;
glDeleteVertexArrays( 1, &nVaoId) ;
return false ;
}
glBindBuffer( GL_ARRAY_BUFFER, nVboId) ;
int nCount = int( vPnt.size()) ;
glBufferData( GL_ARRAY_BUFFER, nCount * SIZEV3F, NULL, GL_STATIC_DRAW) ;
Vert3f v3V ;
for ( int i = 0 ; i < nCount ; ++ i) {
v3V.Set( vPnt[i]) ;
glBufferSubData( GL_ARRAY_BUFFER, i * SIZEV3F, SIZEV3F, &v3V) ;
m_b3Loc.Add( vPnt[i]) ;
}
glVertexPointer( 3, GL_FLOAT, 0, ((void*)(0))) ;
glEnableClientState( GL_VERTEX_ARRAY) ;
glBindVertexArray( 0) ;
// aggiungo i dati in lista
AddVerts( GL_POINTS, nCount, nVaoId, nVboId, bAux) ;
// dichiaro valida la grafica
m_bValid = true ;
return true ;
}
//----------------------------------------------------------------------------
bool
ObjNewGraphics::AddLines( const PNTVECTOR& vPnt, bool bAux)