3D Graphics Tools for Java

3D Graphics Tools for Java

 

 

N. Rao
University of New York Tirana, Albania
narasimharao@unyt.edu.al



Contents

Abstract:

There are several packages for 3D graphics in Java that have come up in the past decade with varying degrees of success. This paper does a survey of not only the features of these tools, but also about their importance and the future prospects of Java based graphics tools. There are powerful graphics libraries such as OpenGL for 3D graphics applications on standalone systems, but there remains a prevalent need for a 3D graphics library aimed at Internet based graphics applications. This has led to a lot of Java based libraries being developed. Some of these tools have become quite popular and some of them have become obscure considering the demands of technology such as band width and complexity. This presents the need for a general comparative survey of some of these tools which are likely to play a major role in the future. It gives a brief description of why some tools have become quite popular. Also we will take a look at the compatibility of these tools with community developed Linux Operating Systems such as Ubuntu, in particular.

1. Introduction

In the past one decade, the Internet has become quite popular and it would not be an exaggeration to say that Internet has in fact become a part of every day life. The Internet is a heterogeneous network environment and this is where Java comes into play. The motto of Java is “Write Once, Run Anywhere”. Hence, a Java based 3D graphics library, if it can run 'anywhere', it would be of immense use in the Internet and this is the reason for the increasing use of Java based tools. The comparative survey of these tools deals with the features, drawbacks and the scope of their use in the future. Also in conclusion, a short analysis has been made in terms of how the end-users can benefit from these tools and libraries, as well as analyzing the target segments for these tools.

2. Brief Introduction of Java Based 3D Graphics Tools

Java based graphics tools can be classified into two categories [14]:
  • 2.1. Low Level Graphics APIs.
  • The features of low level graphics APIs include access to Low Level OpenGL primitives and better performance. However, there are some related drawbacks including the need for the developers to have professional graphics programming experience and increased development time, as it is complex to a certain extent. There are two major tools associated with Low Level Graphics today such as JOGL and LWJGL.

  • 2.2 Screen Graph based Java APIs.
  • The features of Screen Graph based Java APIs includes allowing appearance and other features to be attributed to a group of nodes. It is usually bundled together with low level graphics APIs. This allows greater flexibility while dealing with 3D graphics. However, as every other tool or software, this also has its own set of drawbacks as well. There is a lack of flexibility, compared to using a low level graphics APIs directly. There are many tools based on Screen Graph based Java APIs in market today. Although none of them have a monopoly or domination with developers, six of these tools enjoy a solid base. These six tools are: Java3D, Aviatrix3D, Xith3D, jME, JView, AgentFX.

  • 2.1.1. JOGL

  • JOGL is a binding for OpenGL native 3D graphics library. The minimum requirements for JOGL include the system to have Java 2 platform, along with the presence of an OpenGL library. The major platforms supported include Windows, Linux (AMD64/x86), Mac OS X (10.3 or later) and Solaris (SPARC/x86). Ubuntu has support for JOGL in its latest version v7.04, which is one of the primary advantages of JOGL.

    The development of JOGL started in the summer of 2002 by former MIT graduate students Ken Russell and Chris Kline. However, it was later taken over by the game technology group at Sun Microsystems, and is currently being handled by them. It is available under the Berkeley Software Distribution (BSD) license. It is also referred to as the JSR 231 Specification. The major advantage of JOGL is its industry support which it is receiving in terms of development. Initially JOGL was supported by Sun Microsystems, Apple and IBM, and later by SGI and 3D Labs. The first version of JOGL, named JOGL Version 1.0 was released in April 2004. The current build of JOGL is referred to as JSR-231 1.1.0.

    JOGL has simplified the construction of robust 3D applications and games in the Java programming language. JOGL is designed to provide hardware-supported 3D graphics to applications written in Java. It is part of a suite of open-source technologies initiated by the Game Technology Group at Sun Microsystems [7]. Developers with prior knowledge of OpenGL will find quite comfortable adapting to JOGL because JOGL provides full access to OpenGL API.

    The major Features of JOGL include proving low level bindings for OpenGL and granting full access to Open GL 2.0 Specification. Apart from this JOGL also provides hardware-supported 3D graphics for Java based applications, which gives it a significant edge over other tools. JOGL also has integrated AWT and Swing widget support integrated. The way JOGL functions is that it parses the C header files from OpenGL (which are in ‘C’ only) and then using the Java Native Interface (JNI) converts them to Java libraries. This enables JOGL to access OpenGL library using JNI calls. This functionality marrows down the performance gap between Java and other programming languages. However, there is one major drawback of JOGL, which is likely to be over come in the future versions. It lacks helper functions that are available in Java 3D [8].

    JOGL also has the advantage of being smaller in size and also for its support to OpenGL shading technologies. JOGL is also supported by Linux (AMD64/x86) Distos, such as Ubuntu.

          
               (a)                                                                      (b)


    Fig. 1. Samples of Images using JOGL.

  • 2.1.2. LWJGL (Light Weight Java Game Library).

  • The Light Weight Java Game Library is a Java binding to OpenGL. The Light Weight Java Game Library also has additional game components including human interface which provides it a significant edge over other similar libraries. The only major requirement to use this tool is the presence of Java 2 Platform on the system. The major platforms supported include Windows (98 and above), Linux (AMD64/x86) and Mac OS X (10.2 or later).
    Light Weight Java Game Library was first released in February 2007 as LWJGL 1.0. The next version LWJGL 1.1 was soon released after the first version in April 2007. Light Weight Java Game Library is available under the Berkeley Software Distribution (BSD) license.

    The Features of LWJGL include it being simple, robust and secure. Apart from that LWJGL provides access to OpenGL and OpenAL. It also provides support for development of 3D games and 3D sound. It allows amateur and professional Java programmers to develop games. One of the significant advantages of LWJGL is its support for applets. However, there are two related drawbacks with this tool. As of now there is not support for Swing and AWT, which imposes certain limitations in its usage. In addition, it is not portable with DirectX, but this is not of major consequence as there are provisions within LWJGL which allow such an implementation.

    Additionally LWJGL provides access to controllers such as game pads, steering wheel and joysticks and other such controllers. The latest versions of LWJGL are supported by Ubuntu.

          
               (a)                                                                      (b)
    Fig. 2. Samples of Images using LWJGL.

  • 2.2.1. Java3D

  • Java3D is a client side Scene Graph API based on Java Language. The minimum requirement to have Java 3D is to have Java2 platform on the system. The first version of Java 3D, Java 3D 1.1 was released in December 1998. Although two more versions of Java3D 1.1.2 and 1.2 were released later, there was a short gap in development from mid 2003 until summer 2004, the development process again started during late 2004. Finally Java 3D1.4.0 was released in February 2006. The current development version of Java 3D is 1.5.0.

    The major platforms supporting Java 3D are Windows, Linux (AMD64/x86), Mac OS X (With JOGL), Solaris (SPARC/x86). Java3D is based on the concept of an object-oriented scenegraph. Java 3D provides a purely an object oriented approach of designing 3D systems, and at the same time can render VRML animations. VRML animations have the advantage of being portable to different applications. Apart from that Java 3D also handles 3D rendering by the native code of OpenGL. One of the major advantages of Java 3D is its support for 3D sound.

    Java3D offers support for collision detection and spatial sound. There are three rendering modes: immediate mode, retained mode, and compiled-retained mode, which can be even mixed. This in turn gives the developer a lot of agility while designing graphics [6]. These three rendering modes maximize the performance of the application and that in turn gives the developer a lot of flexibility in terms of performance. However, there are some drawbacks associated with Java 3D. These include compatibility issues associated with various browsers. However, it does offer plug-in support, which means that web based 3D graphics and visualizations can be run using applets [2].

    There is also another shortcoming which developers are likely to encounter with Java3D. Java 3D does have some limitations that is likely to lead them to implementing Java Open GL. The short coming is that Java3D does not allow complete control over images as JOGL. Java 3D is primarily a 3D scene graph API. Java 3D provides a high level, object oriented framework for 3D graphics programming, with about 360 classes. It is an extremely well formulated object oriented scene graph for Java.

    There were initial issues with porting Java 3D applications on Linux based systems, but now the Blackdown Java-Linux implementation of the Java3D 1.3 API is available for Linux/AMD64 and Linux/i386 now. It has to be downloaded and all Java3D applications can now be easily developed on Linux based systems. There is growing integration of Java3D with Linux based Operating systems and this trend is likely to continue with the rising importance of open source based software.

          

          (a)                                                                      (b)

    Fig. 3. Samples of Images using Java 3D.

  • 2.2.2. Aviatrix3D

  • Aviatrix3D is a retained mode Java Scene Graph API over the top of JOGL and JOAL bindings. [9] The minimum requirements for Avaitrix3D include the presence of Java 2 Platform and an OpenGL library. The major platforms supported include Windows, Linux (AMD64/x86), Mac OS X (10.3 or later) and Solaris (SPARC/x86). Aviatrix3D is also supported by Ubuntu.

    The Aviatrix3D Toolkit is an open source API. It is currently distributed under the Lesser General Public License (LGPL). The current Stable Release of Aviatrix3D was released on April 2006. The current development release of Aviatrix3D was released as on January 2007.

    Aviatrix 3D is based on JOGL. Aviatrix 3D is based on an oriented towards large scale visualization. It has excellent performance enhancing strategies and a rendering engine for the Xj3D Toolkit's OpenGL implementation [9]. Apart from that Aviatrix 3D provides support for lightweight and heavyweight rendering, as well as spatialised audio using JOAL bindings. This makes Aviatrix 3d one of the major contenders and a top quality Java based 3D tool.

    The drawbacks of Aviatrix3D include the lack of audio rendering in the beta version which was released this year. Apart from that multi-pass rendering on off-screen textures is not supported currently [9].

          

    Fig. 4. Samples of Images using Aviatrix 3D.

  • 2.2.3. Xith3D

  • Xith3D is a Scene Graph API. The minimum requirements for Xith3D include the presence of Java 2 Platform and an OpenGL library must be present on the platform. The major platforms supporting Xith3D include Windows (98 and above), Linux (AMD64/x86), Mac OS X (10.3 or later), Solaris (SPARC/x86). Xith3D is also well supported by Linux operating System, and its various flavors including Ubuntu.

    The Xith3D project was initiated by David Yazel in 2003. It is available under the Berkeley Software Distribution (BSD) license. The current stable version of Xith3D is v0.8.0 as on June 2006. The latest beta version Xith3D v0.9.0 – beta2 was released on February 2007.

    Xith3D provides input abstraction by using Hybrid Input Abstraction Layer (HIAL) for Java. It consists of powerful middleware including a scenegraph and an extensible renderer. It also has excellent performance enhancing strategies [10]. Another key advantage which makes it so powerful is that it is portable with JOGL and LWJGL. Xith3D also provides good support for game development, and is quite suitable for Prototyping and visualizing 3D models. It uses similar central scene graph structure as Java 3D but can directly call OpenGL operations. [11]

    However there are two drawbacks associated with Xith3D. The major drawback is that there is limited documentation support and apart from that screen graph thread safety not ensured. [11]. However, it is likely that in future versions these drawbacks would be resolved.

          
          (a)                                                                      (b)

    Fig. 5. Samples of Images using Xith 3D.

  • 2.2.4. jME (Java Monkey Engine)

  • Java Monkey Engine is a Scene Graph API. The minimum requirement of jME is the presence of Java 2 Platform. The Major Platforms Supporting Java Monkey engine at the moment are Windows (98 and above), Linux (AMD64/x86), Mac OS X (10.2 or later). The Java Monkey Engine is supported by Linux Operating systems and other community developed Linux operating systems such as the latest version of Ubuntu v7.04. The Java Monkey Engine (jME) was created by Mark Powell in 2003 [12]. jME 0.2 was released on January 2004. The latest version of Java Monkey Engine is jME 0.11, which was released on April 2007. It is available under the Berkeley Software Distribution (BSD) license.

    The features of jME include high performance scene graph based graphics API. It also includes support for AWT, Swing and Applets. They are currently implementing LWJGL 1.0 and future support for JOGL likely [12]. jME currently supports OpenGL and OpenAL. It is best suited for gaming. However, the drawbacks associated with jME include issues with threading, but this not a major issue as work is already under progress.

          
          (a)

    Fig. 6. Samples of Images using jME.

  • 2.2.5. Agent FX

  • Agent FX is a Scene Graph API. The minimum requirement for AgentFX is the presence of Java 2 Platform. The major platforms supporting AgentFX are Windows (98 -and above), Linux (AMD64/x86), Mac OS X (10.2 or later). AgentFX is proprietary software developed by the Swedish company Agency9 [13]. AgentFX version 2.1 was released on January 2005. The latest beta version of AgentFX; AgentFX version 2.2 was released on June 2005. There is support for Agent FX in the latest version of Ubuntu v7.04.

    AgentFX is the dominant platform for the visualization of three-dimensional objects in real time [13]. One of the key advantages is its support for AWT and Applets. AgentFX is platform independent and object oriented design [13]. It offers real-time shadows, render-to-texture support provided which is not available in Java 3D. AgentFX also provides excellent support for gaming. It also offers high performance real time 3D Graphics. The drawbacks associated with AgentFX are the lack of support for applets which is currently not provided.

          

          (a)                                                                      (b)

    Fig. 7. Samples of Images using AgentFX.

  • 2.2.5.JView

  • JView is a Scene Graph API. The minimum requirement for JView is the presence of Java 2 Platform. The major Platforms Supporting JView are Windows (98 and above), Linux (AMD64/x86) and Mac OS X (10.3 or later). JView was developed by the U.S. Air Force Research Lab. It is freeware software. The current version of JView is Version 2.1.1 which was released in May 2006.

    JView provides a rich visual environment for pre-processing tools [14]. The JView API also provides access to low-level OpenGL calls. The key advantage associated with JView is that it offers comparatively better performance. It uses scene graph architecture and is mostly used for visualizations. It also provides support for both 2D as well as 3D Graphics.

    There are some drawbacks associated with JView. They include lack of complete and consistent documentation [14]. One of the major disadvantages associated with JView is that support for applet is currently not available.

          

    Fig. 8. Samples of Images using JView.

3. Conclusion

After comparing all these different 3D graphics tools for Java, we came to a conclusion that each of these tools has its own set of advantages and depending on the purpose of the application; the developer can choose the tool.

4. Suitability of the Tools

    4.1. Java3D

    Java 3D can be handled even by Java developers with minimum experience of Java. Java3D provides quite a useful API which can be used effectively by the programmers. However, there are many issues regarding its performance, due to which tools such as JOGL are slowly dominating.

    The user can combine and correlate text with high quality 3D graphics in his HTML pages. This can be accomplished by the use of applets, and this would give the user better quality graphics to view in the web [6]. The user will also benefit from the CAD applications as well as gaming technology over internet, which in the future, is going to radically change with the use of Java3D.

    4.2. JOGL

    It is suitable as a low level 3D API in the market. It is be easily understood and used by Java developers especially with a good understanding of C as it mainly deals with low level 3D API. However, even Java developers with not much expertise in C can also get accustomed to this quite quickly. JOGL is quite suitable for big projects and interactive applications as it has complete access to all OpenGL calls.

    Users will find the 3D graphics and games based on JOGL a lot more attractive and interactive as JOGL provides full access to the API's in the OpenGL 1.4 specification as well as nearly all vendor extensions, and integrates with the AWT and Swing widget sets [7].

    4.3. Aviatrix 3D

    In our opinion, Aviatrix3D is best suited for needs of the data visualization market as well as modeling, visualization and simulation applications. This makes it a perfect tool for interactive applications. It is certainly not intended for the gaming market.

    4.4. Xith3D

    Xith3D mainly focuses on gaming market rather than visualization sector. It is well suited for both professional and amateur programmers. It offers a wide range of features which can ultimately lead to very high quality games. It is intended mainly for the gaming sector.

    4.5. LWJGL

    This is mainly aimed at professional as well as amateur programmers. The main target segment would be the gaming market, with small and medium level commercial games. LWJGL enables development of games with high quality 3D sound and art. There are limitations due to its lack of support for AWT and Swing.

    4.6. jME

    jMonkeyEngine is best suited for game development. It is more suited for experienced programmers, who can develop highly interactive games. There is a huge potential in the gaming market. The current disadvantage with Windows based DirectX supported gaming is that they can be run only on Windows based systems. However, with the development of the Java based 3D graphics tools, it offers a larger gaming segment, with a large number of people preferring community developed Linux based operating systems such as Ubuntu.

    4.7. JView

    JView has quite a friendly user interface. JView is more suitable for visualization and is a perfect tool for Java based simulation applications. The major advantage with JView is that programmers with either little or no programming experience can easily comprehend JView, as it has quite a user friendly interface.

    There are a wide range of possibilities that the graphics developers have been offered and in our opinion there is a huge scope of development and growth; considering that all the tools discussed can make optimum use of the potential of both Java and OpenGL. In April 2007, the availability of a complete Java Stack in Ubuntu was announced, which is a step forward towards more support for Java based 3D graphics tools in the future on community developed Linux Operating Systems. Java fits perfectly in such cases for development of 3D graphics tools as it is independent of the operating system, and the tools can easily be ported.

    The advantage of incorporating the Java based 3D tools and making them available on Linux based operating systems such as Ubuntu is that there is going to be a huge segment of market in the future, driven by developing countries, using such operating systems. This growth is not only limited to developing countries but also to large parts of Europe are now preferring open source software. Hence Java based 3D tools are going to play a major role not only in the areas of 3D graphics and game development but also in all the related fields of modeling and visualization.

5. Acknowledgements

The authors are thankful to Turlif Vilbrandt, Director of Development in the MIT-FabLab Norway, and to Professor Alexander Pasko from the Bournemouth University, UK, for their help with this manuscript preparation.

6. References

[1] Javahispano.com, 2005, Java 3D, [Online]. http://www.javahispano.org/text.viewer.action?file=chet_en, (Accessed June 29, 2007).

[2] Java.net, 2004, JOGL Success Story, [Online].http://today.java.net/pub/a/today/2004/10/15/jogl.html, (Accessed June 27, 2007).

[3] 3d-test.com, 2006, Middleware 3D Java, [Online].http://www.3d-test.com/interviews/agentfx_1.htm , (Accessed June 29, 2007).

[4] Java.net, 2007, JOGL, [Online]. https://jogl.dev.java.net/nonav/source/browse/doc/userguide/index/html , (Accessed June 28, 2007).

[5] Jdj.sys-con.com, 2003, Java 3D, [Online].http://jdj.sys-con.com/read/37374.htm, (Accessed June 29, 2007).

[6] Geocities.com, 2007, Java3D What Does It Promise? [Online]. http://www.geocities.com/SiliconValley/Horizon/6481/Java3D.html, (Accessed June 29, 2007).

[7] Java.Sun.com, 2004, Professional Java Game Development, [Online]. http://java.sun.com/developer/technicalArticles/games/gdc2004.html, (Accessed June 27, 2007).

[8] Cs.ru.nl, 2006, Atlantis 3D, [Online]. http://www.cs.ru.nl/~ths/master/scriptie/JeroenBroekhuizenScriptie.pdf, (Accessed July 3, 2007).

[9] J3d.org, 2007, Aviatrix 3D Project, [Online]. http://aviatrix3d.j3d.org/, (Accessed July 3, 2007).

[10] Java.net, 2007, Xith3D: Description, [Online]. https://xith3d.dev.java.net/, (Accessed July 3, 2007).

[11] Gamasutra.com, 2005, Scenegraph APIs, [Online]. http://www.gamasutra.com/features/20051216/davison_03.shtml, (Accessed July 3, 2007).

[12] Jmonkeyengine.com, 2007, Features of jMonkey, [Online]. http://www.jmonkeyengine.com/index.php?option=com_frontpage&Itemid=1 , (Accessed July 3, 2007).

[13] Agency9.se, 2007, Overview: AgentFX, [Online]. http://www.agency9.se/products/agentfx/ , (Accessed July 3, 2007).

[14] Nasa.gov, 2004, Advanced Air Transportation Concepts and Technologies, http://asc.nasa.gov/aatt/rto/RTOfinal.pdf, (Accessed July 3, 2007).