Java3D Overlay Library


This code has not been maintained by me since 2001. I gave the bulk of it to j3d.org and ceased using it. If you are interested in it (it worked pretty well), it is best to get the most recent version from them.


This is a library for Java3D to place "overlays" on the screen. An overlay is text or an image that appears to be drawn on the canvas that the scene is rendered on rather than being a part of the scene. It is useful for presenting information about the scene that does not have a spatial relationship to the scene; player information in a video game is a good example.

This library was originally written by David Yazel and was posted to the Java3D listserv, I believe as a part of the game Cosm. I, Will Holcomb, have done some enhancements for use in my work. In addition to the packages posted here, any of the latest revisions are via cvs. (Anonymous cvs will be running soon.)

All of the examples on this page are placed using HTML conformant to the HTML 4.0 object tag specification. If you want to hear a minor tirade ask me sometime about what I think about having to deal with web browsers that do not render the standards correctly. The browser that has the best standards conformance that I have seen is Mozilla. These examples will work there assuming you have the Java Plug-in installed and the Java3D Libraries.

All of these files are alpha code. Any usage in production environments should be tested thoroughly. The latest version of these files are available in the nightly builds and until there is a release those are the recommended sources.


I have done another test program that illustrates how to move the camera's mounted position while maintaining the transform associated with the ViewPlatform. It is using the NavigationHandlers from the j3d cvs. Because the OrbitBehavior can only be used with the ViewingPlatform class it is not possible to change the point that the camera is mounted because when you call ViewingPlatform.setViewPlatform() it does change the ViewPlatform but the ViewTransform stays at the initial position and the OrbitBehavior stays with it so it is no longer possible to move the camera.

This program does not change the camera's mounted position be changing the ViewPlatform, rather it detaches and reattaches a BranchGroup below both the ViewPlatform and the ViewTransform. The NavigationHandler behaviors and the Overlays are both attached to the ViewTransform so they stay with the camera when it moves.

The program itself is a set of spheres spiraling around in a sphere with the brightness going from 1 to 0. Different properties of how the scene is created can be altered in the intial setup dialog.

You can download ViewPlatformTest.jar and run it from the command line; java -jar ViewPlatformTest.jar.