pfuBoxLOD(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
NAME
pfuBoxLOD, pfuMakeBoxGSet - Calculate node bounding boxes and build LODs
from boxes.
FUNCTION SPECIFICATION
#include <Performer/pfutil.h>
pfLOD * pfuBoxLOD(pfGroup *grp, int flat, pfVec4 *color);
pfGeoSet * pfuMakeBoxGSet(pfBox *box, pfVec4 color, int flat);
DESCRIPTION
These functions can be used to automatically generate very simple level-
of-detail representations of a subgraph from the bounding boxes of the
geometric objects contained in that subgraph. Sending a node to
pfuBoxLOD creates multiple representations for that node by finding
bounding boxes at different levels of the scene graph and then using
those boxes as level-of-detail models under pfLOD nodes. The highest
level-of-detail under the pfLOD is simply the original subgraph. The
next highest level-of-detail consists of the subgraph with each pfGeode's
pfGeoSets replaced by a single pfGeoSet depicting a box. Next every
pfGeode is replaced by a single "box" pfGeode. This continues to
progressively lower levels-of-detail as the "box" pfGeodes contain larger
and larger subgraphs, until the box rendered for the lowest level-of-
detail contains the entire subgraph. The new partial subgraphs are
created using pfClone. The LOD transition ranges (see pfLODRange) are
set as integer multiples of the spatial extent of the subgraph.
pfuBoxLOD takes a subgraph grp, a color vector color, and a shading type
flat. grp specifies the existing scene graph hierarchy to be processed.
The color argument provides the color definition used for the boxes that
will be built. The shading type flat determines each pfGeoSet's
primitive type and normals. If flat is non-zero, the generated
pfGeoSet's are made up of PFGS_FLAT_TRISTRIP primitives with face
directed normals. If flat is zero, they consist of PFGS_TRISTRIP
primitives with normals directed radially outwards. The former produces
sharply defined cubes, the latter marshmallows.
To determine the appropriate size of the box geometry, pfuBoxLOD uses
pfuTravCalcBBox to get a tighter bound on the subgraphs than
pfGetNodeBSphere provides.
pfuMakeBoxGSet takes a pfBox box and returns a pfGeoSet containing
drawable geometry that represents the box with color color and a shading
type determined by flat, as explained in the description of pfuBoxLOD
above. The pfGeoSet and associated arrays are allocated from the current
shared memory arena (see pfGetSharedArena).
NOTES
The libpfutil source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
Page 1
pfuBoxLOD(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
BUGS
The LOD transition range setting is very primitive.
SEE ALSO
pfGeoSet, pfLOD, pfLODRange, pfuTravCalcBBox, pfNodeBSphere, pfScene,
pfClone, pfGetSharedArena
Page 2