Java 3D meets JavaFX

At the end of the day Friday, a couple of colleagues invited me to brainstorm with them about a 3D data visualization tool. I have heard that JavaFX will have 3D capabilities, perhaps yet this year, but I needed something sooner than that. After the session I searched for the latest developments in the intersection of JavaFX and Java 3D. I was pleasantly surprised by the great work that a German organization named InteractiveMesh.org has done in the 3D space relative to JavaFX.


Java3D-meets-JavaFX

As you may know, you can wrap a Java 3D canvas in a JavaFX component, but there are a couple of issues with this:

  • The 3D canvas is a heavyweight component, so a JavaFX node placed on top gets obscured.
  • Interfaces between the JavaFX scenegraph and the Java 3D universe would be required in order to provide a great user experience.

The screenshot above shows a Java 3D universe placed in a JavaFX program, and thanks to the libraries created by InteractiveMesh.org the 3D universe is rendered into a lightweight component. Also, their libraries provide for integration between the JavaFX scenegraph and the 3D universe (such as redirecting mouse events to the underlying heavyweight Canvas3D object).

Their site has a couple of JavaFX/Java 3D demos, the screenshot above showing one of them. When running the demos, be sure to discover the various interactions that the mouse provides. For example, you can scale the cube above with a mouse wheel, and can drag the cube while holding mouse button #2 down. Congratulations and thanks to InteractiveMesh.org, and to August Lammersdorf whose name is in the source code.

0 comments:

Yang Sering Dibaca: