Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
Sun and its partners developed the Java Media and Communication APIs to provide the missing multimedia programming pieces. Two of the biggest pieces, 2D and 3D graphics, are targeted with the Java 2D and 3D APIs, respectively. Java 2D is a core platform API beginning with Java 1.2, while Java 3D will be released as an Extension API shortly after the 1.2 platform becomes available. We have recently finished a series of columns on Java 2D; now we turn our attention to Java 3D.
Java 3D is meant to give Java developers the ability to write applets and applications that provide three dimensional, interactive content to users. Sun has some heavy competition from other 3D graphics technologies in this arena, and Java 3D has an uphill battle ahead of it if it's to defeat the incumbent graphics standard, OpenGL.
A request for reader comments on 3D graphics APIs for Java indicated serious interest in Java 3D and Java OpenGL bindings, so I've decided to concentrate my efforts on these technologies in the coming months.
A more limited amount of interest was expressed in VRML. Consequently, I am going to deal with VRML by demonstrating its use in Java 3D with VRML97 content loaders and Sun's Java 3D VRML97 browser. Direct3D received very little interest, so I've decided not to pursue this path, except to mention where one of the other technologies may support or interoperate with it.
This month we begin our tour of 3D graphics APIs for Java by exploring Java 3D. We'll start by discussing some of the API's major strengths and weaknesses. 3D graphics can seem at times rather obtuse and, thus, can be difficult to explain. If you have any lingering confusion about my examples or explanations, please feel free to write me with your questions or comments, and I'll do my best to address them.
Selling points for Java 3D:
javax.vecmath package and may be moved into the core platform in the future.com.sun.j3d.utils.trackers package included with Sun's implementation provides classes for Fakespace, Logitech, and Polhemus devices. These devices
are not widely used, however, so I will not discuss them in great detail. If you're interested in finding out more about device
support, please refer to Sun's Java 3D sites and the Java 3D mailing list archive (both available from the main Sun Java 3D
URLs included in the Resources below).Java 3D has a lot of pros, but what about the cons? They include:
Now that we understand the major features and constraints of Java 3D, let's get ready to try out some example code.
Java 3D is available in beta for Win32 and Solaris. The more mature of Sun's implementations of Java 3D is built on top of OpenGL. An alpha-quality Direct3D implementation is also available for Win32. All require Java 1.2, with the latest Java 3D beta corresponding to Java 1.2 Beta 4. Sun has promised to release the final Java 3D implementation shortly after it releases Java 1.2, which is currently scheduled for December 1998.
A slightly confusing aside: Sun released Java 3D 1.0 alpha implementations, which corresponded to the Java 3D 1.0 API, but it never released anything beyond alpha for the 1.0 API. Sun then modified the API, releasing the modified version as the Java 3D 1.1 API. This version was followed with releases of what it called 1.1 beta implementations, two so far. Sun has promised to release a final API and implementation shortly after the final release of the Java 1.2 platform. Hopefully, the API has stabilized and won't be revved, yet again, with the world still waiting on a bonafide final release of an implementation.
Because we will be covering Java OpenGL bindings in a future column, I have decided to economize and use the OpenGL version of Java 3D in these installation instructions too. If you install the OpenGL version to use with these Java 3D examples, you will have the rendering libraries you need for the Java-OpenGL examples to come later.
The software components you need to use Java 3D are:
Optionally, you may also want to download the Java 3D documentation and example code. Both are available from the same link as the Java 3D runtime.
Please note that you are no longer required to set the CLASSPATH environment variables in order for your java or appletviewer executables to find extension libraries. With Java 1.2, Sun has finally created a standard extension directory. This directory is located at /jre/lib/ext/ within your JDK installation directory. For instance, on my system, Java 1.2 Beta 4 is installed at:
C:\jdk1.2beta4\
and the standard extension directory is at:
C:\jdk1.2beta4\jre\lib\ext\
All extension libraries should place their jar archives into this extensions directory at install-time, and all standard JDK tools know to search here for needed class files.
For Sun's Java 3D, these archives include both public (documented in the Java 3D API specification) and private (Sun implementation-specific) classes. Public class archives include:
j3dcore.jar -- Contains class files for the public Java 3D package javax.media.j3d.vecmath.jar -- Contains classes for javax.vecmath.
Private archives include:
j3daudio.jar -- Archives the com.sun.j3d.audio classes, which build support for spatialized audio on top of a custom copy of the Java portion of the Java Sound, Headspace-based
audio engine, debuting in Java 1.2.j3dutils.jar -- Encapsulates a variety of Sun utility classes in 16 total packages and subpackages underneath com.sun.j3d. I will dig deeper into these packages in next month's continuation of our Java 3D discussion.j3dutilscontrib.jar -- Archives useful utilities contributed by others to Sun's efforts. There are seven packages under the com.sun.j3d hierarchy, including the com.sun.j3d.utils.trackers code mentioned above. Again, next month's column will provide more information on the packages in this jar.Please note that in theory you may instantiate and call methods on any of the classes provided in nonstandard packages like
com.sun, but caveat emptor: There is no guarantee they will be available on the platform your code executes on. In current practice, Java 3D is only
available from Sun, so a lot of developers do, in fact, use classes within Sun's private archives. You should be aware of
the potential portability trade-off entailed in choosing to do so.
There's no magic in how the public and private Java 3D classes interface with system resources, either. Sun installs native
libraries in J3D.dll and j3daudio.dll under the /jre/bin/ directory. The Java 3D classes use native methods to call these DLLs and interface with the Win32 platform and OpenGL rendering
library. (Similar libraries exist for Solaris implementations.)
One final note on installation: The OpenGL rendering pipeline is designed to take advantage of OpenGL acceleration hardware to speed up your graphics applications. For the purposes of this column, though, you should be able to experiment with the examples without any special hardware. (In fact, I'm developing all the examples on a Pentium 150-MHz MMX laptop with no OpenGL acceleration hardware.) If you're interested in acceleration cards, you should refer to the OpenGL Web site or the Java 3D mailing list (see Resources) for more information. I plan to include a little more information in next month's Java 3D column on acceleration hardware, too.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq