Java 3D™ meets Swing



Image

Heavyweight Internal Frames  ↓ 

Lightweight 3D Rendering  ↓ 

Stereoscopic 3D Rendering  ↓ 


Sample Programs


The sample programs on this page require: Java Plug-in JRE™ 5 (6 Update 18+ recommended) and Java 3D 1.5.2. If Java 3D isn't installed on your system yet, please use the 'incl. Java 3D' links. See Java 3D home page on java.net for more informations and downloads [link].

All programs provide 3D mouse navigation. The left button rotates, the middle button zooms, and the right button drags the scene. Most of the interaction buttons are rendered in a label-style. Move your mouse over them, see if their color is changing, and wait for a hint. Some of the programs allow to center a shape by a double mouse click. Zooming in or out changes its size. Selecting one of the viewpoints will reset the scene.

 →     ↑   

Java 3D Forum. Thread: JCanvas3D Anaglyph provides stereoscopic 3D rendering.

[Thread]


JCanvas3DAnaglyph

JCanvas3DAnaglyph provides stereoscopic lightweight rendering for Java 3D. This API is a derived work of the Java 3D utility class JCanvas3D.

OrbitBehaviorAnagylph

OrbitBehaviorAnaglyph provides mouse navigation capabilities for JCanvas3DAnaglyph based stereoscopic 3D rendering. It is a derived work of OrbitBehaviorInterim 2.1.


Redistribution and use are permitted according to the standard Java 3D core utility copyright notice (BSD).

JCanvas3DAnaglyph0.5.zip includes binaries, apidoc, sources, and license.  [download]

OrbitBehaviorAnagylph0.5.zip includes binaries, apidoc, sources, and license.  [download]


Image

Sample Stereoscopic 3D 0.5  (Proof of Concept)


Paper anaglyphic glasses with red-cyan filters (left-right) are needed to see the stereoscopic 3D effect.


Stereoscopic3D0.5.zip [download]

 ←    →     ↑   

Java 3D Forum. Thread: JCanvas3DYUp & JCanvas3DOB : Lightweight 3D Rendering.

March 13, 2009


JCanvas3DYUp speeds up the lightweight 3D rendering of JCanvas3D.

The JCanvas3DYUp API creates its off-screen buffer in 'yUp' mode. While drawing the corresponding image is flipped vertically on the fly. This results in a faster running Java 3D rendering loop.

Redistribution and use are permitted according to the standard Java 3D core utility copyright notice (BSD).

JCanvas3DYUp1.0.zip includes binaries, apidoc, sources, and license.  [download]


JCanvas3D and JCanvas3DYUp are both not fully synchronized with the Swing painting loop. Therefore, visual artifacts might appear on the display in case of a large off-screen buffer/panel and a fast rendered 3D scene. Alternatively, the double buffered JCanvas3DOB should be chosen.


JCanvas3DOB provides fast and fully synchronized lightweight Java 3D rendering.

The JCanvas3DOB API allows to run the Java 3D rendering loop in parallel to the Swing painting loop with minimal synchronized overlap. A Double Off-screen Buffer, also in 'yUp' mode, provides a fast running Java 3D rendering loop. Mixing of 2D and 3D rendering as well as adding arbitrary operations can easily be implemented in subclasses (see samples below).

Redistribution and use are permitted according to the standard Java 3D core utility copyright notice (BSD).

JCanvas3DOB1.0.zip includes binaries, apidoc, sources, and license.  [download]


Image

Sample TuxCubeGrayscale 1.0


The lightweight 3D rendering component JCanvas3DOB Grayscale renders colored Java 3D scenes monochromatically in Java Swing applications and applets.


TuxCubeGrayscale1.0.zip [download]


Image

Sample DistortStringReflection 2.0


The lightweight 3D rendering component JCanvas3DOB Reflection provides reflection capabilities for arbitrary Java 3D scenes in Java Swing applications and applets.


DistortStringReflection2.0.zip [download]

 ←           ↑   

Swing & AWT Forum. Thread: Heavyweight Internal Frames : Java 3D Sample.

[Thread]


Mixing heavyweight and lightweight components in Swing.

As of the JRE 6 Update 12 release mixing heavyweight and lightweight components works almost perfectly. JInternalFrames with a heavyweight content are now supported, e.g. javax.media.j3d.Canvas3D.


Image

Sample PropellerUniverse 2.0

Sample program requires JRE 6 Update 12+.

PropellerUniverse2.0.zip [download]

Description

  • Canvas3D objects are added to JInternalFrame objects. They render simultaneously four views into an animated 3D scene.
  • One Canvas3D object fills the entire desktop pane as a background.
  • The other three frames can be maximized and minimized as well as dragged and resized in outline or live mode.
  • Controls are added to another internal frame which is in the palette-layer and can be dragged in live mode.
  • While dragging or resizing an internal frame in outline mode four line-panels are set visible in the drag-layer.
  • Two layouts, Discret and Overlap, can be selected to locate the Canvas3Ds and the control panel. The chosen layout remains effected until a Canvas3D is dragged or resized.
  • A virtual title bar is implemented which allows to drag an internal frame with the left mouse button and to maximize/minimize it by a double click of the left mouse button.
  • A context menu (JPopupMenu) is shown on top of an internal frame when the right mouse button is clicked. This menu allows to reset the viewpoint, to toggle between windowed and simulated full-screen mode, and to exit the application.

The 3D model based on the external 3D file format VRML™ (*.wrl) was replaced with a model of the successor format Extensible 3D (X3D™, *.x3d). The download includes the new X3D model and the corresponding importer API XModelImporter J3D. For more details see [here].