18.5. Adaptive Viewing

Functionality was added to every viewer class in Open Inventor to be able to control the update rate, either through fixing the frames per second (setGoalFramesPerSecond()) or the number of primitives rendered (setGoalNumberOfTriangles()). For the viewer to be successful, there need to be nodes in the scene graph that can produce multiple levels of detail. What the adaptive viewers offer is a way for the user to set complexity goals that the dynamic nodes in the scene graph try to achieve.

Open Inventor implements adaptive viewing through a new action, SoGetPrimitiveCountAction SoGetPrimitiveCountAction SoGetPrimitiveCountAction , and a new element, DecimationPercentage (setFixedPercentage). SoGetPrimitiveCountAction SoGetPrimitiveCountAction SoGetPrimitiveCountAction is used by the viewer to calculate the complexity of the scene graph by counting the number of triangles, points, lines, text and images. It then can decide to render some lesser percentage of these primitives. The viewer can fix the frame rate by timing each render and then adjusting the decimation value to keep the frame rate within some desired range.

An example demo program, the QtLargeModelViewer, has been developed to demonstrate this functionality. With this program you can control the complexity of scenes output from the mesh decimation algorithm. In addition, you can control scenes that contain LOD nodes, such as many VRML files on the World Wide Web, and nodes that respond to the complexity element, such as Spheres, Cones, Cylinders, NURBS Curves and Surfaces, and 3D Text.

For more information, see SoWinViewer SoWinViewer , SoXtViewer , or SoQtViewer in the online documentation and the QtLargeModelViewer example in the directory $OIVHOME/src/Inventor/examples/Qt/QtLargeModelViewer.