IRIX 6.5 » Books » Developer »
OpenGL Optimizer Programmer's Guide: An Open API for Large-Model Visualization
(document number: 007-2852-002 / published: 1998-06-09)
table of contents | additional info | download find in page
Appendix D. Scene Graph Tuning With the opoptimize Application
The opoptimize application illustrates the basic structure of a scene-graph tuning application. Scene graph tuning is typically done before rendering. As a result, opoptimize is usually used in batch processing mode. However, opoptimize does allow scene-graph rendering interactions using an opViewer (see “Viewing Class: opViewer”). The output of the application is typically a scene graph that can be easily manipulated in an application like opviewer, which was discussed in Chapter 2.
This chapter presents lines of code that are essentially the same as those of /usr/share/Optimizer/src/sample/opoptimize/main.cxx. Comments highlight OpenGL Optimizer features when they are used by the code, and direct you to detailed discussions that appear in this guide.
The main tools not included in opoptimize are tools for multiprocessing, which are discussed in Chapter 14, “Managing Multiple Processors.”
This appendix discusses opoptimize in the following sections:
Values Returned by Scene Graph Tools
When you use OpenGL Optimizer methods that construct scene graphs and csGeoSets, you must not use input pointers after the method call. Input objects may change as a result of applying the method or they may be included in the output. This may occur, for example, with the simplifiers, tessellators, and spatialization tools.
If an input object is included in the output, subsequent changes to the original input may affect the output object. For example, if you generate a level of detail node by simplifying a csGeoSet and you want to use color to distinguish the levels of detail, but the simplifier could not change the input because of the criteria you used, then a color change applied to input will also change the color of the output.
If you want to use an input scene graph or csGeoSet after a call to any modifying method, make a copy first.
Compiling and Running opoptimize
To compile opoptimize, enter the command make while in the directory /usr/share/Optimizer/src/sample/opoptimize.
To run opoptimize, recall that command-line options are listed if you invoke the application without any command-line arguments. To print a list of interactive program controls into your command shell while you run opoptimize, place the mouse cursor in the rendering window and enter h.
Figure D-1 illustrates simplification of the original model of 19474 polygons to 10902 to 4938 polygons. The three panels in the figure correspond from left to right to the following three commands:
# opoptimize kittyHawk.iv -rotation 1 0 0 1
# opoptimize kittyHawk.iv -rotation 1 0 0 1 -simpPercent 50 0 1 0
# opoptimize kittyHawk.iv -rotation 1 0 0 1 -simpPercent 15 1 2 1
The simplifier used for these images is discussed in “Methods in opSimplify”.
The rest of this chapter is a running commentary on the code in main.cxx.
 | Note: The sequence in which tools are applied to the scene graph in opoptimize is not fundamental to a scene-graph tuning application; if you use opoptimize as a template, other orderings may be more appropriate for your needs.
|
OpenGL Optimizer Programmer's Guide: An Open API for Large-Model Visualization
(document number: 007-2852-002 / published: 1998-06-09)
table of contents | additional info | download
Front Matter
About This Guide
Part I. Getting Started
Part II. High-Level Strategic Tools for Fast Rendering
Part III. Specific Tools for Fast Rendering
Part IV. Managing and Rendering Higher-Order Geometric Primitives
Part V. Traversers, Low-Level Geometry Processing, and Multiprocessing
Part VI. Utilities and Troubleshooting
Part VII. Appendices
Glossary
Index
home/search |
what's new |
help
|