Over a million developers have joined DZone.

Speeding up the JavaFX Presentation Cube for Jfokus

· Java Zone

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

I'll be traveling to Stockholm in a few days to give a University session on JavaFX at Jfokus on January 27, 2009.  During that week on January 29-30 I'll also be teaching an intensive two-day class on creating JavaFX applications, with a focus on developing Rich Internet Applications.  In the past I've used a rotating cube developed in JavaFX to display static and dynamic (executing JavaFX code) content.


The cube uses the PerspectiveTransform effect to do faux-3D, and was running at around 10 frames per second.  I asked Stephen Chin if he could tune it up a bit, and he sent me back a modified program that consistently achieves 60+ FPS on my dual core 2.4 GHz Vista machine.  In a later post Stephen and I will point out the optimization techniques used, but for now I wanted to give you a Java Web Start link to try it out: 


To see the FPS that the cube is achieving on your machine, take a look at the Java console.  It also displays any acceleration type in use.  Here's my console output for reference:

Acceleration Type is: Direct3D
Animation FPS: 62
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 63
Animation FPS: 64

By the way, the presentation slides in the example that you'll be running are dated, but I'll post the actual Jfokus presentation cube on this blog for you shortly after the session.  Also, as I mentioned in yesterday's WidgetFX 1.0 post, I'll show you the code for this presentation cube as well as walking through how to tweak the code to convert it into a WidgetFX widget.

Jim Weaver

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}