Java 3D™ meets JavaFX™


Java 3D Forum. Thread: Java 3D meets JavaFX.

January 14, 2009

Sun Forums: JavaFX General. Topic: JavaFX 3D powered by Java 3D.

March 16, 2009



Image

FXCanvas3D API  :  Java 3D Scene in JavaFX Scene ↓ 

FXCanvas3DMV API  :  Multiple 3D Scene Views  ↓ 

FXCanvas3DImage API  :  3D Scene as BufferedImage ↓ 




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

All programs provide 3D mouse navigation. The left button rotates, the middle button zooms, and the right button moves 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.

Current JavaFX Runtime: 1.1 / 1.2
(Porting of samples to 1.2 in progress / Java APIs FXCanvas3D and FXCanvas3DImage are not affected)


FXCanvas3D API

 →     ↑   

FXCanvas3D enables JavaFX to draw the Virtual Universe.

Java 3D provides 3D rendering into a lightweight component which can be added via a resizable JavaFX SwingComponent to a JavaFX Scene.

The FXCanvas3D API includes an implementation of such a component and allows to run the Java 3D rendering loop in parallel to the JavaFX painting loop with minimal synchronized overlap.

Since version 2.0 the off-screen buffers are created in 'yUp' mode. 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).

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



Image

Sample FXCharacterCube 3.0  (JavaFX 1.2)


Sample program requires font 'Lucida Sans'.


JavaFX Web Start   [launch] /  [launch incl. Java 3D]

JavaFX Applet   [applet] /  [applet incl. Java 3D]


FXCharacterCube3.0.zip  [download]


Apply the JavaFX effects Bloom, GaussianBlur, or SepiaTone to the Java 3D scene. Pick a character or the cube by a double click of the left mouse button to center the 3D shape. Zoom in or out to change the size. Select one of the viewpoints to reset the scene.


Image

Sample FXDistortString 4.0  (JavaFX 1.2)


JavaFX Web Start   [launch] /  [launch incl. Java 3D]

JavaFX Applet   [applet] /  [applet incl. Java 3D]


FXDistortString4.0.zip  [download]


Random positioning of the 3D characters' vertices creates this distortion animation. The JavaFX effect Reflection draws the reflected version. Play with its attributes to discover all facets of this effect.


FXCanvas3DMV API

 ←    →     ↑   

FXCanvas3DMV supports multiple simultaneous views into Java 3D scenes.

 


Image

Sample FXTuxInTheBox 1.1 - Early Access  (JavaFX 1.2)


JavaFX Web Start   [launch] /  [launch incl. Java 3D]


Six simultaneous views into a Java 3D box are assigned to six JavaFX faces which build the shape of a box by applying the JavaFX effect PerspectiveTransform. Determine the direction and the speed of the continuous rotation by dragging the box. This application is using source code of the JavaFX sample 'VideoCube'.


FXCanvas3DImage API

 ←           ↑   

FXCanvas3DImage provides the Java 3D scene by a BufferedImage object.

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

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


Image

Sample FXPropellerPuzzle 2.0  (JavaFX 1.1)


JavaFX Web Start   [launch] /  [launch incl. Java 3D]

JavaFX Applet   [applet] /  [applet incl. Java 3D]


FXPropellerPuzzle2.0.zip  [download]


The Java 3D scene of an animated propeller engine is splitted into several puzzle pieces. The puzzle board is resizeable from 2x2 up to 11x11 pieces on a screen of 1200 pixels height. This application is using source code of the JavaFX sample 'PuzzlePieces'.

The engine animation, the viewpoint setting, and the 3D mouse navigation (on the puzzle board) are enabled even if the puzzle pieces are shuffled.

As the JavaFX loop is not yet synchronized with the monitor's vertical refresh adjust the minimum frame cycle time to avoid any visual artifacts. 'Play' also with this cycle time when you run the engine at high speed.