The Nodal Scene Interface (NSI) is a simple yet expressive API to describe a scene to a renderer. From geometry declaration, to instancing, to attribute inheritance and shader assignments, everything fits in 12 API calls. The following subsection demonstrate how to achieve most common manipulations.
Geometry Creation
Creating geometry nodes is simple. The content of each node is filled using the NSISetAttribute
call.
/** Polygonal meshes can be created minimally by specifying P. C++ API provides an easy interface to pass parameters to all NSI API calls through the Args class. */ NSI::Context nsi; nsi.Create( "simply polygon", "mesh" ); NSI::ArgumentList mesh_args; float points[3*4] = { ... /* insert your favorite 4 points here */}; mesh_args.Add( NSI::Argument::New( "P" ) ->SetType( NSITypePoint ) ->SetCount( 4 ) ->SetValuePointer( const_cast<float*>(points) ); nsi.SetAttribute( "simple polgyon", mesh_args );