| BspLib is a C++ class library
from which a BSP compiler for 3-D objects can be built very easily. It
consists of a class hierarchy for handling three-dimensional objects, together
with various processing functions, the most important of which is BSP compilation.
An I/O class hierarchy is provided for importing and exporting 3-D data.
Aside from proprietary formats BspLib is capable of reading VRML V1.0 data
files. A slightly modified version of Silicon Graphics' QvLib is employed
for parsing the VRML V1.0 file format. Apart from the included version
of QvLib, BspLib is completely self-contained, i.e., only the standard
C++ run-time library (no STL needed!) need be linked to be able to use
all functions. This, for example, means that VRML primitives (spheres,
boxes, cones, cylinders) have to be tessellated on-the-fly prior to BSP
compilation, in order to convert them to b-reps that can be BSP compiled.
Since BspLib is able to create BSP trees for entire VRML scene graphs this
also means that all transformations and modifications demanded by the scene
graph have to be applied to achieve correct spatial relationships between
contained objects, without which BSP compilation is not possible. Normally,
all this would only be done when rendering the scene, since OpenGL supports
exactly those operations very easily. That is, primitives would be submitted
to OpenGL in implicit (non-polygonal) form and transformations would be
done on-the-fly through OpenGL's matrix stack. Since one goal of BspLib
was to make it possible to build a purely command-line BSP compiler without
any additional libraries, potentially running on a large variety of platforms
(which only need to support C++), OpenGL could not be used to alleviate
the problem of supporting an entire VRML scene graph. So, in contrast to
many VRML viewers, some basic OpenGL functionality had to be duplicated
within BspLib. |