Information about Inventor Files

Open InventorTM is an object-oriented 3D toolkit offering a comprehensive solution to interactive graphics programming problems.
It presents a programming model based on a 3D scene database that dramatically simplifies graphics programming.
It includes a rich set of objects such as cubes, polygons, text, materials, cameras, lights, trackballs, handle boxes, 3D viewers, and editors
that speed up your programming time and extend your 3D programming capabilities.

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.