/**
Polygonal meshes can be created minimally by specifying "P".
NSI's C++ API provides an easy interface to pass parameters to all NSI
API calls through the Args class.
*/
const char *k_poly_handle = "simple polygon"; /* avoids typos */
nsi.Create( k_poly_handle, "mesh" );
NSI::ArgumentList mesh_args;
float points[3*4] = { -1, 1, 0, 1, 1, 0, 1, -1, 0, -1, -1, 0 };
mesh_args.Add(
NSI::Argument::New( "P" )
->SetType( NSITypePoint )
->SetCount( 4 )
->SetValuePointer( points ) );
nsi.SetAttribute( k_poly_handle, mesh_args );
|