The current JavaFX 1.1 API is focused around two-dimensional (2D) graphics. Future versions of JavaFX will integrate a three-dimensional (3D) scene graph. In the meantime, though, there’s no reason not to roll your own 3D graphics software. The following simple demo app shows a super-early version of a 3D vector graphics engine in action.
Click on the image to launch the app
While the 3D engine is only early stage, and incredibly simple, this app illustrates a couple of features:
- The 3D physics engine and the on-screen 2D graphics are linked by using the neat JavaFX bind mechanism. That means, as the 3D world changes during the simulation, the JavaFX platform takes care of updating what’s happening on the computer screen automatically.
- The 3D scene is lit such that objects closer to the viewer appear brightly colored, whereas objects far from the viewer appear dimly lit. The idea is to help with the viewer’s perception of depth in the scene.
Obviously, there’s lots still to do; but even this simple 3D engine isn’t too far away from enabling various applications in domains as diverse as video games and scientific data visualization. In a subsequent post, I’ll show some more 3D “visual cues” in action that, combined with the lighting used in this demo, enhance the feeling of 3D.
I’ll try to keep track of any comments, suggestions, questions etc. here. Or you can hit me up on Twitter ( @psynixis ), or on my blog.
No comments:
Post a Comment