Technical Description

The tool reads a VRML file and generates LODs for each IndexedFaceSet and IndexedLineSet. As described in the picture below the program replaces each IndexedFaceSet by a LOD node and inserts in this node a new IndexedFaceSet for each Level of Detail. It can happen that faces are collapsed into lines. If this lines are equal to an edge of another face this lines will be discarded. But the remainding lines will be written out into an extra IndexedLineSet. In this case the IndexedFaceSet and IndexedLineSet node of this Level of Detail must be surrounded by a Separator node (e.g. see LOD 1 in the picture below).

The LOD-generator can't accept some bindings (PER_FACE, PER_PART, PER_VERTEX) these bindings are 1:1 relations and they can't maintained if different LODs uses the same materials or normals. For that reason these bindings will be transformed into an appropriate indexed binding and indices will be sythesized. In this case it is necessary to write out an additionally MaterialBinding respectively NormalBinding node.

Because the tool splits non convex faces into triangles the face type can be set to CONVEX. If the face type isn't convex in the actual state, the program generates an additional ShapeHints node for setting the type to convex.

If the program has generated one or more additional nodes (MaterialBinding, NormalBinding, ShapeHints) than a surrounding Separator must be generated.

If a name was assigned to the original IndexedFaceSet using the DEF statement the DEF will be moved before the outermost node. This is either a Separator (e.g. in the picture below) or the LOD node.

IndexedLineSet nodes are handled similar. Polylines will always be split into single lines.


Outline of the Method


Summary of used Algorithms