Introduction to Inventor

Darren Meyer, WPI CS Department

Inventor is an object-oriented 3-D graphics library that was developed by Silicon Graphics, Inc. (SGI). The original version, Iris Inventor, was built on top of Iris GL and only worked on SGI workstations. However, recently several companies, including DEC, IBM, Intel, Microsoft, and SGI, have founded the OpenGL review board to create the OpenGL specification, a platform-independent graphics library based on the technology of Iris GL. Along with OpenGL this board has created the OpenInventor specification, which is built on top of Open GL and is based on the technology of Iris Inventor. Due to this, OpenInventor is now available for SGI and Hewlett-Packard workstations, and implementations for other platforms should be available soon, including PC and Macintosh personal computers. Unless otherwise noted, all of the below information applies to both Iris Inventor and OpenInventor.

Inventor is an object-oriented system with a C++ and C application programmer's interface (API) to create a 3-D space and then render that space. While GL provides a low-level state machine for rendering 2-D and 3-D graphics that is procedural based, Inventor is a high-level descriptive graphics system. Thus instead of making calls to render each object, in Inventor developers describe the objects in the scene (shapes, lights, cameras) and the relationships between them. Control is then passed to the Inventor engine, which renders the scene and handles user interactions. The relationship between GL and Inventor is thus similar to the relationship between Xlib and Motif in the X Windows system. Due to the optimizations done in Inventor and the support for programmers specifying additional optimizations, SGI argues that very little performance is lost by using Inventor instead of GL, and often performance enhancements are seen even in their programs.

One of Inventor's main focuses is supporting interactive 3-D scenes. It supplies very simple mechanisms that allow the programmer to specify the means for interaction, and then Inventor automatically handles choosing objects, moving around the scene, and manipulating objects in the scene. Inventor also supports animation, although for virtual reality and visual simulation tasks SGI's Performer library will give higher performance and help calculate positioning and intersections.

The benefits of Inventor include:

The core concept of Inventor is the scene graph. A scene graph is a directed acyclic graph where each node effects the nodes to the right of it and below it. Each of the nodes in the graph represent a system object, which may be a shape, an appearance characteristic, a transformation, a camera, or a light. 3-D scenes are created by organizing the nodes in the scene graph so that they inherit the correct characteristics. In the text below, "the nodes after node A" refers to all of the nodes to the right of node A and below node A in the scene graph.

Some of the many types of nodes that are available are:

Represents a 2-D or 3-D object, such as a cone or cube
Represents a 3-D transformation, such as translation or scaling
Changes the appearance of the shapes after it
Lights the nodes after it
Views the nodes after it
Separates the effects of the nodes below it from the nodes to the right of it.
Specifies the type of real-world measurement units for the nodes after it (such as inches), and a scaling factor if the the nodes before it use a different unit of measurement.
Detects when an event occurs (a timer goes off, a node was picked), and calls a user-defined callback function.
Allows users to change the scene graph, such as a trackball to change a transformation, which to the user would be moving and rotating objects.
Specifies the rendering quality for the nodes after it.
Specifies the texture for the nodes after it.
Specifies environmental effects, such as smoke or fog.
Used for lighting and texture calculations.

A sample scene graph appears below. This is a simple scene graph for drawing and viewing a dumbbell. All scene graphs start with a root, and usually have a camera as the leftmost node so that the rest of the scene graph is visible. Next is a light to light the scene. If the light appeared after the first sphere subtree, the objects in the subtree would not be visible because they wouldn't be lit. Next are the shapes in the scene, each of which has their own subtree that is separated off so their individual shapes can be aligned properly without effecting the rest of the scene.

Sample Inventor scene graph

The strengths of the scene graph basis of Inventor can now be described using the previous example. Since nodes effect the nodes to the right and below them, it is possible to create a transformation that moves the entire dumbell as a single unit by inserting a transformation node after the light node. Changing the material characteristics could be done by inserting a material node after that. This hierarchy becomes very important for more complex scenes, such as when trying to model a robot. For example, a transformation node after the lighting can be used to move the entire robot. After the main transformation could be a subtree to represent each arm and leg of the robot, the head, and the body. This way the arms can be designed separately from the rest, with their own materials and transformations. Within each arm could be separate subtrees for the upper arm and the lower arm and hand, so that they can be positioned separately, and so when the lower arm moves the hand will as well. The hand could then have separate subtrees for each finger, and so on. As in object-oriented programming, the Inventor scene graph allows designing each part of the scene and their relationships separately from the rest of the scene, which lower level 3-D libraries don't allow.

The basic shapes provided by Inventor are boxes, cones, spheres, and cylinders. Inventor also allows specifying 2-D and 3-D text, and NURBS curves and surfaces (Non-Uniform Rational B-Splines). To create new complex objects face sets and triangle meshes are provided. Face sets specify objects based on their polygon faces using vertices and normals. Triangle meshes are face sets where each polygon is a triangle.

For each shape in a scene properties usually need to be specified. These can include materials, which specify the ambient, diffuse, specular and emissive colors, shininess, and transparency. There are also draw style nodes, which specify whether to do full rendering, wireframe models, points, or not render objects at all. Complexity nodes allow defining drawing precision, which can be based on the object type or the screen space consumed. Another property node is the light model node, which can be used to specify whether to use base color modeling (no blending) or Phong modeling. The shading of objects is determined by a combination of the material, lighting, and object normals. Finally, shape hints nodes allow giving hints on how the shape is designed (solid or not, ordered or not, convex or not) in order to help optimize rendering. When applying any of these properties to objects they can be bound to a vertex, to a face, or to the entire object. This allows creating color blends across a face.

Inventor also supports texture mapping, allowing the texture to be bound to object vertices. Inventor gives a lot of control over texture mapping, so that the method of wrapping textures and how textures are re-sized to objects can be specified. Textures can also be combined with the object's material specifications to create sophisticated effects, such as using a single texture map to create green marble in one place and multi-hued marble elsewhere. Texture maps can contain intensity or RGB values, and can also specify transparency levels.

For the environment, Inventor environment nodes can be used to simulate fog, smoke, haze, or other effects. The ambient light, attenuation of light, color, and density can all be specified. These effects can be applied per vertex or per pixel in the scene.

Inventor's lighting includes point lights (light bulb in the scene), directional lights (sunlight), spot lights (flashlights), and ambient lights. Lights can support characteristics such as location, drop off rate, direction, and angular range, where applicable.

Inventor supports perspective and orthographic cameras. They support having positions and orientations, specific aspect ratios, near and far clipping planes, and focal distances. All of these characteristics can be set using several of the standard graphics mechanisms. Convenience routines are included to point at a specific location, or to view all of a specified subtree.

For animation support Inventor supplies sensors such as the timer sensor, which goes off at a specified interval and calls a user supplied callback function. This callback function can be used to change the scene graph, such as modifying a camera position by small amounts to move through a scene. OpenInventor now provides engines as well, which can be used to move objects automatically. An example of this is using an engine to spin the vanes of a windmill.

Once a scene graph is established, Inventor allows applying actions to the scene. This can be rendering to a screen or PostScript file, reading or writing a scene from or to a file, computing a matrix, searching for nodes, calculating bounding boxes, or picking an object. Inventor includes many settings to help increase performance, such as caching of subtrees, varying transparency modes, and optional levels of antialiasing. Inventor makes full use of hardware graphics support on most machines, such as the advanced hardware support on SGI workstations.

One of Inventor's main focuses is user interaction. Scenes can be rendered to a number of pre-defined viewers, which allow the user to move around in the scene in a variety of ways, such as walking or flying. Using a viewer is extremely easy for a programmer, as Inventor automatically handles moving about the scene. Inventor also provides components that can be used to present dialog boxes to the user, such as a color selection dialog box. Inventor manipulators allow the programmer to add user interface objects to the scene graph so the user can modify scene characteristics. This includes trackballs for rotating subtrees, light manipulators, and handle boxes for moving objects. These all have visible user interfaces to supply feedback to the user. Finally, Inventor supplies high performance object picking mechanisms so users can click on objects they want to manipulate. This takes a large burden off the programmer, as they only need to include sensor objects to detect picks instead of tracking mouse clicks themselves.

Silicon Graphics Inventor demo program inside of a viewer

For more information on Inventor, see the Iris Inventor or OpenInventor programming manuals. The Iris Inventor programming guides are a 3 volume series supplied with Iris Inventor, while the OpenInventor manuals are available from most bookstores. The OpenInventor manuals are called "The Inventor Mentor" and "The Inventor Toolmaker", and are published by Addison-Wesley. The SGI Inventor software distributions also include source code that can be installed in /usr/people/4Dgifts, and additional source code and information is available at :

The Inventor frequently asked questions document is available at:

For WPI students, Iris Inventor is available on the SGI workstation in the computer science database research lab. The manuals for Inventor are next to the computer. See Professor Hachem or Ward in the CS department for access. Professor Ward and Darren Meyer have both written programs using Inventor, and can supply source code and demonstration programs.

[Return to CS563 '95 talks list]