
22 IDiscovering
// create an instance of the class:
// (the real constructor is in the Begin method )
VertexBufferObject VB;
VB.CollapseCommonVertices( true );
VB. SetTol( .001 f );
...
// this goes in the part of the program where graphics things
// get initialized once :
int x, y; // loop indices
float ux , uy; // utm coordinates
VB. Begin( GL_LINE_STRIP );
for(y=0,uy=meteryMin; y < NumLats ; y ++, uy += meteryStep )
{
VB.RestartPrimitive( );
for( x = 0, ux = meterxMin; x < NumLngs x++, ux += meterxStep )
{
float uz = Heights [ y*NumLngs + x ];
VB. Color3f ( 1., 1., 0. ); // single color = yellow
VB. Vertex3f ( ux , uy, uz );
}
}
for(x=0,ux=meterxMin; x < NumLngs ...