Java 3D Overview

Java 3D Overview

Chi Chung Ko (National University of Singapore, Singapore) and Chang Dong Cheng (CCS Automation PTE LTD, Singapore)
Copyright: © 2009 |Pages: 14
DOI: 10.4018/978-1-59904-789-8.ch002
OnDemand PDF Download:


In the last chapter, a brief introduction on the creation of 3D content through the use of Java 3D and other programming methodologies for virtual reality applications has been Given .Before giving details on the various Java 3D classes and functions in subsequent s, we will now discuss the basic Java 3D program structure in this . Specifically, JDK installation, programming and compiling tools, as well as the difference between Java 3D applet and application will be explained. Originated from Sun Microsystems, the Java 3D API is made up of a few packages (Java platform API specification, 2006), which in turn contain the classes of some related components and elements. Specifically, the package (Package, 2006) contains the most basic classes, often referred to as core classes, which are needed to create a Java3D program. Note, however, that a complete application will often use many other packages and classes as well. As an example, if there is a need to use vectors, points and matrices to draw the virtual universe, the package javax.vecmath (Package, 2006) has to be imported. Another important package is java.awt (AWT stands for Abstract Windowing Toolkit), which include classes to create a window to display the rendering. Associated with each class is a variety of methods to aid the programmer in creating the application. Together, these classes and methods give the programmer the basic tools to construct a simple rotating cube system to a 3D virtual city. An important concept in Java 3D programming is that the program and the programming objects created has a tree like structure. Thus, a Java3D program will create and instantiate Java 3D objects and places them in a virtual world through the use of a tree like scene graph. This will be explained in greater detail in subsequent sections
Chapter Preview

Getting Started

To develop an application in Java3D, several tools for writing, compiling, running, and debugging Java3D programs are needed. Appendix A gives details on the various steps needed for downloading three major tools, the Java Development Kit (JDK), the JCreator Integrated Development Environment and the Java3D Application Programming Interface (API), for this purpose. Note that the steps described are for workstations that have not had any Java applications or programs installed in the system. For PCs with Java programming tools already installed, only step three will need to be carried out.

The JDK bundle comprises some programming tools and the Java Runtime Environment (JRE). The latter consists of the Java Virtual Machine and class libraries that will be used in a production environment. The programming tools include the following primary components:

  • Javac, for converting a Java source code to a Java bytecode.

  • Jar, for archiving related class libraries into a single JAR file.

  • Javadoc, for generating documentation from source code comments.

  • Jdb, the debugger.

A number of sample programs are also included in the JDK bundle.

The JCreator IDE serves to aid programmer in developing and running programs. It consists of a source code editor, a compiler, some build automation tools and a debugger. The JCreator IDE is for programming in Java (and Java3D) and will enable compiling, debugging and the running of Java programs using the appropriate menu options.

Perhaps most importantly, the Java3D API provides the tools needed for programming in Java3D and running 3D-programs. This API is basically an extension of the JDK bundle, and the downloaded files will simply be added to the appropriate .bin and .lib folders in the JRE that was created when the JDK bundle was installed onto the system.

Lastly, all these software are freely available from


A Simple Java3d Programjava 3D Program For A Rotatingcube

To illustrate the main principles and components needed for creating a Java3D application, Figure 1 shows a simple program for creating a rotating color cube.

Complete Chapter List

Search this Book:
Table of Contents
Chi Chung Ko
Chapter 1
Chi Chung Ko, Chang Dong Cheng
Web-based virtual reality is fast becoming an important application and technological tools in the next generation of games and simulation as well... Sample PDF
Virtual Reality and Java 3D
Chapter 2
Java 3D Overview  (pages 18-31)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, a brief introduction on the creation of 3D content through the use of Java 3D and other programming methodologies for virtual... Sample PDF
Java 3D Overview
Chapter 3
Geometry Objects  (pages 32-74)
Chi Chung Ko, Chang Dong Cheng
To create 3D graphics, we have to build graphics or visual objects and position them appropriately in a virtual scene. In general, there are three... Sample PDF
Geometry Objects
Chapter 4
Appearance Objects  (pages 75-96)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, the creation of the skeletons or shapes of 3D objects has been discussed through the use of geometry objects in Java 3D. In... Sample PDF
Appearance Objects
Chapter 5
Textures  (pages 97-113)
Chi Chung Ko, Chang Dong Cheng
Although extensive use of basic attributes such as color and material will be able to make an object realistic to the human user, it will be time... Sample PDF
Chapter 6
Chi Chung Ko, Chang Dong Cheng
How the properties of virtual 3D objects can be specified and defined has been discussed in earlier chapters. However, how a certain virtual object... Sample PDF
Lighting, Fog, and Background
Chapter 7
Animation Objects  (pages 132-158)
Chi Chung Ko, Chang Dong Cheng
We have discussed important Java 3D objects that are basically static in the last few chapters. Starting from this chapter, we will be looking at... Sample PDF
Animation Objects
Chapter 8
Interaction  (pages 159-187)
Chi Chung Ko, Chang Dong Cheng
In Chapter VII, we discussed how animation can be applied in Java 3D to increase the visual impact of a virtual 3D world and illustrate the dynamic... Sample PDF
Chapter 9
Picking  (pages 188-216)
Chi Chung Ko, Chang Dong Cheng
The last two chapters have discussed how animation and interaction can be created in Java 3D to increase visual impact, to show object dynamics and... Sample PDF
Chapter 10
Chi Chung Ko, Chang Dong Cheng
One of the most useful and important advantages of 3D graphics rendering and applications is that there is the possibility for the user to navigate... Sample PDF
Navigation, Input Devices, and Collision
Chapter 11
Multiple Views  (pages 238-263)
Chi Chung Ko, Chang Dong Cheng
Our discussions in previous chapters have centered on the creation and interaction of visual objects in a virtual 3D world. The objects and scenes... Sample PDF
Multiple Views
Chapter 12
Audio  (pages 264-275)
Chi Chung Ko, Chang Dong Cheng
Of all the human perceptions, two of the most important ones are perhaps vision and sound, for which we have developed highly specialized sensors... Sample PDF
Chapter 13
Chi Chung Ko, Chang Dong Cheng
In this final chapter, we will describe the use of Java 3D as a visualization technology in the development of a Web-based 3D real time oscilloscope... Sample PDF
A Web-Based 3D Real Time Oscilloscope Experiment
Appendix A: Downloading Software
Appendix B: Running the Rotating Cube Program
Appendix C: ViewManager
Appendix D: Main Applet for Web-Based 3D Experiment
Appendix E: Scene Graph Implementation for Web-Based 3D Experiment
Appendix F: Knob Class for Web-Based 3D Experiment
Appendix G: Navigation and Collision Detection for Web-Based 3D Experiment
Appendix H: Picking for Web-Based 3D Experiment
Appendix I: Program Summary and Screen Capture
About the Authors