provided by: 
Originally published at Internet.comJava Programming Notes #1541 * Preface * General * Acknowledgement * Viewing tip * Figures * Listings * Supplementary material * General background information * Preview * Discussion and sample code * The program named Java3D001 * The program named Java3D002 * The program named Java3D003 * Run the programs * Summary * What's next? * Downloads * Resources * Complete program listings * Copyright * About the author -----------------------------------
Preface
General
Scope of the series of tutorial lessons
In the earlier lesson titled "Understanding Lighting in the Java 3D API" (see Resources), I taught you about, and showed you examples of many of the important features of scene illumination in the Java 3D API. I also provided the source code for a complete Java 3D lighting simulator program that you can use to experiment with light in the Java 3D API. At the end of that tutorial, I stated "I will explain how the Java 3D lighting simulator program works in subsequent parts of this multi-part lesson."
Upon reflection, I have decided that it would be impractical for me to attempt to explain the inner workings of that very complicated program without first explaining a large number of basic concepts involved in writing programs using the Java 3D API. Therefore, beginning with this lesson, my plan is to start with the basics and to publish a series of tutorial lessons in which I will work my way up to the general complexity exhibited by the program that I provided in the earlier lesson. This will be the first lesson in that series.
Compiling and running Java 3D programs
In order to compile and run programs using the Java 3D API, you will need to download and install the Java 3D API software. As of the date of this writing, version 1.5.0 was available for download.
In addition, you will need to download and install either Microsoft DirectX or OpenGL. All of the sample programs in this series of tutorials were developed and tested using Microsoft DirectX. They were not tested using OpenGL.
Acknowledgement
Most of what I will be teaching you about the use of the Java 3D API was learned by studying the tutorial by Dennis J Bouvier (see Resources) along with some other online material listed in Resources.
You can also download the Bouvier tutorial as a set of PDF files along with the source code for the example programs in his tutorial. I recommend that you take advantage of those resources as well.
Viewing tip
I recommend that you open another copy of this document in a separate browser window and use the following links to easily find and view the ffigures and listings while you are reading about them.
Figures
* Figure 1. Bouvier's recipe for using the SimpleUniverse class to create a Java 3D virtual universe. * Figure 2. Sun's description of the SimpleUniverse class. * Figure 3. Description of one of the available constructors for the SimpleUniverse class. * Figure 4. Target Java 3D virtual universe for this lesson. * Figure 5. Virtual universe produced by program Java3D001. * Figure 6. Sun's description of the Group class. * Figure 7. Sun's description of the BranchGroup class. * Figure 8. Virtual universe produced by Program Java3D002. * Figure 9. One of two Canvas3D constructors. * Figure 10. Virtual universe from a future lesson.
Listings
* Listing 1. The program named Java3D001. * Listing 2. The program named Java3D002. * Listing 3. Beginning of the program named Java3D003. * Listing 4. Two placeholder objects. * Listing 5. Create empty Java 3D universe. * Listing 6. Same code as before. * Listing 7. Legacy code from earlier tutorials. * Listing 8. Listing for program Java3D001. * Listing 9. Listing for program Java3D002. * Listing 10. Listing for program Java3D003.
Supplementary material
I recommend that you also study the other lessons in my extensive collection of online Java tutorials. You will find a consolidated index at www.DickBaldwin.com.
General background information
A Java 3D virtual universe
Obviously, programs that you create using the Java 3D API will have a strong visual component. We can refer to that visual component as a Java 3D virtual universe.
Bouvier tells us that "A Java 3D virtual universe is created from a scene graph. A scene graph is created using instances of Java 3D classes. The scene graph is assembled from objects to define the geometry, sound, lights, location, orientation, and appearance of visual and audio objects." He then goes on to tell us just how complicated it can be to create such a virtual universe.
A simplified approach
Fortunately, he then introduces us to the class named SimpleUniverse and tells us "Using the SimpleUniverse class in Java 3D programming significantly reduces the time and effort needed to create the view branch graph. Consequently, the programmer has more time to concentrate on the content." He then goes on to provide the recipe shown in Figure 1 for using the SimpleUniverse class to create a Java 3D virtual universe.
Figure 1. Bouvier's recipe for using the SimpleUniverse class to create a Java 3D virtual universe. 1. Create a Canvas3D Object 2. Create a SimpleUniverse object which references the earlier Canvas3D object a. Customize the SimpleUniverse object 3. Construct content branch 4. Compile content
Author: Richard G. Baldwin
Read article at Internet.com site