< Zurück | Inhalt | Weiter >

7.1.1 Surface models

Typically, geometry is described as a collection of triangles, or faces, that define an approximation of the outer skin of the object. Importantly, most rendering hardware is optimized to render triangles. Unfortunately, defining objects using a triangular skin description loses many important properties of a 3D model.


A triangulation, by its nature, makes assumptions regarding the rendering hardware available to an application. The application developer may want to create an application that renders an object on a low−end system using 100 triangles, while rendering the object using 10,000 triangles on high−end systems. Such formulations can be accommodated by using a LOD description that allows an application to load several definitions of an object and choose the one most appropriate given the object’s position in the scene and system performance. It may also be possible to dynamically retriangulate the points that compose the surface of the model. This technique is commonly applied to terrain using variants of the ROAM algorithm. The Virtual Terrain site (http://www.vterrain.org) contains may good links to terrain rendering.


Any skin (surface triangulation) description cannot, by its nature, contain information for the internal characteristics of an object. Skin descriptions are merely concerned with surface appearance, and generally assume homogenous (or irrelevant) internal characteristics. Solid modeling operations—operations such as generating two new objects by slicing a plane through an object—are also difficult to implement using a triangular skin description.


Figures 7.1 and 7.2 show a 3D−facial model rendered as a simple skin model. A pair of carefully calibrated cameras was used to capture the model (including a photo realistic texture image). Surface construction was then performed on the input data to generate triangles, calculate normal vectors, and texture coordinates.

Finally the processed data was saved as a VRML file and interactively rendered.

image


Figure 7.1 Skin description. Each triangular face is rendered using an applied texture image


image


Figure 7.2 Skin description. Each triangular face is rendered using three lines with a texture image applied


If your geometry is very dynamic, as in character animation, you should definitely consider using Java 3D geometry−by−reference support. Releases of Java 3D earlier than version 1.2 would always copy the arrays of data values you passed to it into internal data structures. Java 3D version 1.2 introduced a geometry−by−reference feature that eliminates the copying, and greatly improves performance through increased rendering speed and reduced heap allocation and garbage collection. See the GeometryArray class and GeometryUpdater interface for details of using geometry−by−reference.