

Additionally, the application can compile some or all of the subgraphs that make up a complete scene graph. The scene graph describes the objects in the virtual universe, the arrangement of those objects, and how the application animates those objects.ġ.2.2.3 Compiled-Retained ModeCompiled-retained mode, like retained mode, requires the application to construct a scene graph and specify which elements of the scene graph may change during rendering. Of course, the application can build these lists of points, lines, or triangles in any manner it chooses.ġ.2.2.2 Retained ModeRetained mode requires an application to construct a scene graph and specify which elements of that scene graph may change during rendering. An application must provide a Java 3D draw method with a complete set of points, lines, or triangles, which are then rendered by the high-speed Java 3D renderer. Even so, Java 3D has raised the level of abstraction and accelerates immediate mode rendering on a per-object basis.

Most Java 3D applications will want to take advantage of the convenience and performance benefits that the retained and compiled-retained modes provide.ġ.2.2.1 Immediate ModeImmediate mode leaves little room for global optimization at the scene graph level. Each successive rendering mode allows Java 3D more freedom in optimizing an application's execution.
JAVA 3D RACING GAMES HOW TO
Java 3D allows the programmer to think about geometric objects rather than about triangles-about the scene and its composition rather than about how to write the rendering code for efficiently displaying the scene.ġ.2.2 Rendering ModesJava 3D includes three different rendering modes: immediate mode, retained mode, and compiled-retained mode (see Chapter 12, "Execution and Rendering Model"). The Java 3D API improves on previous graphics APIs by eliminating many of the bookkeeping and programming chores that those APIs impose. Chapter 2, "Scene Graph Basics," provides more information on the Java 3D scene graph programming model.

This includes the geometric data, the attribute information, and the viewing information needed to render the scene from a particular point of view. The scene graph contains a complete description of the entire scene, or virtual universe. The application manipulates these objects using their predefined accessor, mutator, and node-linking methods.ġ.2.1 The Scene Graph Programming ModelJava 3D's scene graph-based programming model provides a simple and flexible mechanism for representing and rendering scenes. Applications construct individual graphics elements as separate objects and connect them together into a treelike structure called a scene graph. This allows Java 3D to accommodate a wide variety of file formats, such as vendor-specific CAD formats, interchange formats, VRML 1.0, and VRML 2.0.ġ.2 Programming ParadigmJava 3D is an object-oriented API.
