A Java-based VRML 2.0-Browser: CASUS Presenter

Arno Schäfer, Wolfgang Müller, Volker Luckas
Fraunhofer Institute for Computer Graphics
Wilhelminenstraße 7
D-64283 Darmstadt, GERMANY
aschaefe@igd.fhg.de, mueller@igd.fhg.de, luckas@igd.fhg.de

Abstract

This paper introduces CASUS Presenter, a VRML 2.0 based presentation tool developed at Fraunhofer IGD, Darmstadt. CASUS Presenter supports interactive 3D visualization of simulation data, making use of animation and interactive walk-throughs. Since CASUS Presenter is based on VRML 2.0 and fully implemented in Java, it can be used as a flexible VRML 2.0 browser in various application scenarios on different platforms. In this paper, we will concentrate on the fundamental concepts and certain implementation aspects of CASUS Presenter. Additionally, we will present a number of application examples.

1 Overview

In many application areas, communication using 3D graphical information is getting increasingly important today, as special hardware supporting fast 3D visualization is getting more and more common. The emerging ISO standard VRML (Virtual Reality Modeling Language) will certainly play a central role in the communication of 3D graphical information on the World Wide Web. CASUS Presenter is a general-purpose VRML 2.0 Browser and presentation tool developed at Fraunhofer IGD Darmstadt, which is tailored to these new application areas. CASUS Presenter was developed for interactive 3D visualization of simulation data, making use of animation and interactive walk-throughs. Since CASUS Presenter is based on VRML 2.0 and implemented in Java, it can be used as a flexible VRML 2.0 browser in various application scenarios, especially in World Wide Web applications. Moreover, the use of Java combined with a standard 3D graphics library in the realization of CASUS Presenter allowed to combine very good performance with high portability.

CASUS Presenter currently supports the following features:

CASUS Presenter takes advantage of existing 3D hardware through OpenGL. It runs on SGI IRIX, Sun Solaris, Windows 95, and Windows NT. It requires the Open Inventor 3D Graphics library.

2 Conception

CASUS Presenter is a general purpose VRML 2.0 Browser. VRML ([BEL95], [BEL96]) is the emerging standard for exchanging interactive 3D content on the World Wide Web. It is, therefore, an obvious choice as a data format for interactive 3D graphics applications, such as visualization of simulation data.

For the development of CASUS Presenter the main goals were:

Platform Independence
In most scientific and technical application areas, a number of different machine architectures are used. In order to provide the user with a consistent application interface across different platforms, it is necessary to keep the visualization system as platform-independent as possible.
Flexibility
Although CASUS Presenter was primarily developed as a visualization tool for a simulation system, one of the goals was to keep it flexible enough to be reusable for many different application scenarios.
Extensibility
Since it is difficult to anticipate the requirements of all possible application scenarios, even a flexible system has its limits. Therefore, it is imperative to make the system easily extensible.
Performance
In interactive 3D applications, performance is one of the key factors for user acceptance; therefore, special attention must be given to system performance.

The primary reason for developing CASUS Presenter was to support animation and behavior in VRML in order to be able to use VRML for the visualization of dynamic processes. To obtain maximal flexibility in the definition of behavior, some programming or scripting facility is highly desirable. This programmability must be provided in a platform-independent way, to satisfy the requirements stated above. The VRML 2.0 specification suggests the Java and JavaScript ([NET96]) programming languages for behavior definition. Java ([GOS95]) is a platform-independent, object-oriented programming language and, as such, is ideally suitable for the distribution of executable programs on a heterogeneous network like the Internet. As a full-featured, general purpose programming language, it offers a wide range of networking, mathematical and user interface functions, among other things. Additionally, the byte code format, in which Java executables are transmitted, allows faster interpretation than pure script languages, and thus offers better performance. Therefore, Java was selected as the programming language for the definition of behavior modules (Script nodes in VRML 2.0) in CASUS Presenter.

The primary advantage of Java also applies to the implementation of CASUS Presenter itself: the use of Java makes it immediately portable to a wide range of platforms. By using Java as the basis for the implementation of CASUS Presenter, it was also possible to take advantage of many of the advanced features of a modern, object-oriented programming language, and to provide Java support for VRML in a direct way. Java's platform independence, however, implies that its code is slower to execute than native machine code. Implementing 3D rendering in Java would be prohibitively slow; therefore, an efficient native 3D graphics library must be used. The library chosen was Open Inventor by Silicon Graphics, Inc. ([WER94]). It is optimized for interactive 3D graphics and its data model is very similar to that of VRML, because VRML 1.0 was derived from Open Inventor. Additionally, Open Inventor supports available 3D hardware through the OpenGL library, and is available for a variety of platforms. Nevertheless, the use of a native library affects the portability of CASUS Presenter; this is further discussed in Section 3.

The structure of CASUS Presenter is visible in the data flow graph shown in Figure 1. The main function blocks are the Parser, which reads VRML 2.0 input and creates a scene graph consisting of VRML nodes; the Kernel, which is responsible for rendering and navigation, and the Node Block, which represents the functionality contained in the nodes.

Figure 1: Data Flow in CASUS Presenter

CASUS Presenter consequently follows the object-oriented paradigm, so that most of the functionality, such as event handling and execution of Java programs in Script nodes, is encapsulated inside the nodes. A clearly defined Node Interface, through which Parser and Kernel interact with the nodes, makes addition of new nodes easy and ensures the browser's extensibility by defining a standardized API to the VRML objects and browser functionality. Figure 2 shows the generic structure of a node. Nodes are created during parsing of the VRML input. The parser looks up the requested node in the node database and creates a new instance of the node. It then initializes the node with the field values read from the VRML input. Nodes that require additional data, such as textures or Java programs, load that information directly from the network or disk. The event handling block receives events from other nodes via the eventIn interface, or directly from the kernel. The node can react to events by updating its internal fields or additional data, and by sending out new events to other nodes via the eventOut interface.

Figure 2: Generic Node Structure

VRML defines a set of nodes that are combined in the browser to construct the scene graph that represents the 3D scene. The logical structure of the scene graph is defined by the VRML grammar. In CASUS Presenter, each VRML node is represented by a Java object that contains the node's data. Open Inventor also uses a scene graph structure to represent a scene. The Open Inventor scene graph is very similar to the VRML scene graph, but is usually not entirely equivalent. The chosen mapping between the two is shown in Figure 3. The VRML scene graph is "overlaid" with the Open Inventor scene graph, and each VRML node contains a reference to the corresponding Open Inventor node(s).

Figure 3: This graph shows the Mapping between the VRML Scene Graph and the Open Inventor Scene Graph: one VRML node can contain multiple Open Inventor nodes; other nodes such as the Script node may have no corresponding Open Inventor node at all

3 Realization, Performance, and Portability

CASUS Presenter accesses the Open Inventor library through the Kahlua Interface, which is a freely available Java wrapper for the Open Inventor library ([WHI96]). Figure 4 shows the different layers of CASUS Presenter.

Figure 4: The Different Layers of CASUS Presenter

Kahlua uses the native code interface of Java to make the Open Inventor classes available to Java applications. By using Kahlua, it is possible to develop 3D graphics applications in Java using Open Inventor, just as one would do in C++. When an Open Inventor object is created or a method is called from within a Java program, the corresponding method in the C++ library is invoked. Thus, one takes advantage of performing computation-intensive 3D operations in a graphics library on the system level, while retaining the robustness and ease of use of Java.

Because of Java's nature as an interpreted language, it is slower to execute than native machine code, and special attention must be given to the performance of the browser. Tests with large VRML models confirm that good interactive performance can be achieved using the approach described. No significant difference is noticed when compared to the performance of Open Inventor applications or VRML browsers written entirely in C/C++. Moreover, use of Open Inventor guarantees that the browser automatically takes advantage of existing 3D graphics hardware through the OpenGL library, as soon as an OpenGL binding exists for the respective hardware. This distinguishes CASUS Presenter from VRML browsers using pure software rendering.

CASUS Presenter is implemented completely in Java, which means that it is implicitly portable to other platforms, even in binary form. It depends solely on the availability of the Java runtime system and the Kahlua Open Inventor bindings on the target system, which in turn require the Open Inventor and OpenGL libraries. Java and Open Inventor/OpenGL are available for a variety of platforms, including several Unix systems and Windows 95/NT. Consequently, only Kahlua needs to be ported in order to make CASUS Presenter available on a new platform. A port to Windows 95/NT is currently under way. The relatively limited work required for this is a demonstration of the advantages of Java for cross-platform development.

4 Examples

Figures 5 to 7 show examples from dynamic 3D visualizations with CASUS Presenter.

Figure 5: Example Scene from a Logistics Simulation in CASUS Presenter

Figure 6: Example Animation Sequence in CASUS Presenter, using VRML 2.0 OrientationInterpolator nodes

Figure 7: Forklift-controlled by a Java program, using the VRML 2.0 Java API and functions from the Java Abstract Window Toolkit (AWT)

5 Conclusion and Future Work

CASUS Presenter is a successful example of an interactive 3D graphics application written mostly in Java. It proves that Java is suitable even for the development of large and time-critical applications. It also demonstrates Java's advantages in development for multiple platforms: only the lower level libraries have to be ported; the main program runs without modifications and does not even require recompiling for porting to a new machine.

Moreover, CASUS Presenter shows an easy and extensible integration of VRML 2.0 and Java. The support for Java in Script nodes enables the development of rich, interactive 3D scenes with animation in a platform-independent format. Java behavior programs are not restricted to simple animation commands, but can contain arbitrarily complex code, such as user interface functions as shown in Figure 7.

Due to its extensibility, CASUS Presenter can be used as the basis for developing platform-independent 3D graphics applications with a uniform user interface. As such, CASUS Presenter defines a high level API to 3D Graphics in Java based on VRML.

Currently, CASUS Presenter is being used for visualization of 3D data converted from output of the logistics simulation system CASUS (Computer Animation of Simulation Traces, [JES96]). The complete integration into the simulation system is being worked on. Areas of future work include the extension of CASUS Presenter with high level Audio capabilities, including speech input, as well as multi-user functionality. Another area is the development of a library of powerful, reusable behavior modules performing frequently needed functions, such as for virtual actors ([MCK90]) and multi-body simulations ([KÜH93]). This library could serve as a basis for a graphical authoring system for 3D animations, in which behavior modules can be easily combined with geometry descriptions in order to create 3D objects encapsulating their behavior. The user of such a system would not need to do any programming in Java to animate a VRML scene.

CASUS Presenter is freely available to the public under the following address:

http://www.igd.fhg.de/CP/index.html

6 Bibliography

[BEL95] G. Bell, A. Parisi, and M. Pesce: The Virtual Reality Modeling Language: Version 1.0 Specification, http://vrml.wired.com/vrml.tech/vrml10-3.html, May 1995.

[BEL96] G. Bell, R. Carey, and C. Marrin: The Virtual Reality Modeling Language Specification: Version 2.0, http://vag.vrml.org/VRML2.0/FINAL/, August 1996.

[ENC93] J. L. Encarnação, D. Krömker, J. M. de Martino, G. Englert, S. Haas, E. Klement, F. Loseries, W. Müller, G. Sakas, and R. R. Vohsbeck-Petermann: Advanced Research and Development Topics in Animation and Scientific Visualization, R. A. Earnshaw, D. Watson (ed.). Animation and Scientific Visualization, Tools and Applications, Academic Press, Harcourt Brace & Company, 1993.

[GOS95] J. Gosling and H. McGilton: The Java Language Environment: A White Paper, SUN Microsystems, http://www.javasoft.com/doc/white_papers.html, October 1995.

[JES96] U. Jessen, D. Krömker, F. Loseries, V. Luckas, S. Wenzel: Realitätsnah planen: Die 3D-Visualisierung als ideale Ergänzung zur Simulation, Workshop "Visualisierungsverfahren beim Einsatz der Simulationstechnik in Produktion und Logistik", 7. ASIM Fachtagung, Dortmund, 1996.

[KÜH93] V. Kühn, W. Müller: Advanced Object-oriented Methods and Concepts for Simulations of Multi-body Systems, The Journal of Visualization and Computer Animation, Vol. 4, pp. 95-111, 1993.

[MCK90] M. McKenna and D. Zeltzer: Dynamic Simulation of Autonomous Legged Locomotion, Computer Graphics, Vol. 24, pp. 29-38, August 1990.

[NET96] Netscape Communications Corporation: Netscape JavaScript, http://home.netscape.com/comprod/products/navigator/version_2.0/script/index.html, 1996.

[SCH96] A. Schäfer: Animation and Behavior Description in VRML, Diploma Thesis, Darmstadt University of Technology, Dept. of Computer Science, Interactive Graphics Systems Group, Darmstadt, 1996.

[WER94] J. Wernecke: The Inventor Mentor: Programming Object-Oriented 3D Graphics with Open Inventor, Release 2, Addison-Wesley, 1994.

[WHI96] J. White: Kahlua: A Java Wrapper to the Open Inventor 3D Graphics Library, http://www.cs.brown.edu/~jsw/kahlua/home.html, 1996.





Return to Top of Page
Return to Posters Index