Open Inventor has an associated file format, which is the format you will utilize for your graphics output files.
Here is an Open Inventor file that has several yellow line segments.
Here is an Open Inventor file that has two red polylines.
Here is an Open Inventor file that has two polylines and two spheres.
Note that for lines (and triangle meshes) the vertices are separate from the topology. First a 3D coordinate list of points is created. The lines and polylines are formed by indexing into the list. The index -1 indicates the end of a vertex list. Colors are specified in RGB, with component values ranging from 0.0 to 1.0. Spheres are centered around the origin of their own local coordinate system, so they need to be translated. Using the PHONG LightModel will smooth-shade the spheres during display.
Here is an Open Inventor file that has two triangles.
Here is an Open Inventor file that has two triangles that have colors defined at their vertices.
Here is an Open Inventor file that has two triangles that have normals defined at their vertices.
Here is an Open Inventor file that contains many flat-shaded triangles.
Note: the ShapeHints parameters ensure that the triangles are rendered
on both front and back faces. Like lines, the vertices of the triangles
are in one structure and they are referenced from another (IndexedFaceSet).
-1 indicates the end of a face index list.
In two_triangles_flat_colors.iv multiple colors are listed in the Material object which are referenced using materialIndex in the IndexedFaceSet. The colors are interpolated over the triangles. PER_VERTEX_INDEXED must be set/enabled for this to work.
In two_triangles_smooth.iv normals are defined for each vertex of the triangles. The normals are interpolated over the triangles to produce a smooth-shading. Again PER_VERTEX_INDEXED must be set.