Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeMidnight
titleC++
collapsetrue
/**
	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 );


Code Block
languagecppperl
themeMidnight
titleNSI Streamcollapsetrue
## 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.

Create "simple polygon" "mesh"
SetAttribute "simple polygon"
	"P" "point" 1 [ -1  1  0   1  1  0   1 -1 0   -1 -1 0 ];

...