Graphics Reference
In-Depth Information
VA->CollapseCommonVertices( true );
VA->UseBufferObjects( true );
VA->SetTol( .001f );
VA->glBegin( GL_QUADS );
for( int i = 0; i < 6; i++ )
{
for( int j = 0; j < 4; j++ )
{
GLuint k = CubeIndices[i][j];
VA->glColor3fv( CubeColors[k] );
VA->glVertex3fv( CubeVertices[k] );
}
}
VA->glEnd( );
VA->Print( );// verify that vertices were really collapsed
. . .
// this goes in the display-callback part of the program:
VA->Draw( );
Figure D.1. The cube drawn by this code example, with axes added to show how the colors
correspond to the vertex coordinates.
Search WWH ::




Custom Search