Java3D in fullscreen mode

Hey,

Is there anyone out there who has done work with Java3D in fullscreen exclusive mode?

I have an application which mixes 3D and 2D by displaying a Canvas3D among other AWT and Swing components. That all works fine, but I would like to move it to the fullscreen exclusive mode provided by Java 1.4.

I have tried creating the Canvas3D as an offScreen canvas and on each pass of the render loop (I’m using active rendering and would prefer to do so if possible) I call renderOffScreenBuffer() and waitForOffScreenRendering() and then I use getImage() to grab a BufferedImage which I then draw to my Graphics object from the Bufferstrategy. (phew, long sentence, but I hope you’ll get my drift…)

It works, but much too slowly. I get no more than 3-4 FPS on a 2.6Ghz P4, which of course is not enough for any practical use.

Does anyone know of a better way to do this? Is there a faster way to get an image from an offscreen Canvas3D.

Any suggestions or ideas highly appreciated.
Thanks,
D

Mixing 3D and 2D is hard and most often a very bad idea. It will split performance between the two. A much better way is to use Java3D to simulate your 2D scene. Besides Java3D can optimize things a bit.

About fullscreen mode just use a plain window with a canvas3D on it. Set the required options for the configuration and let the java apis take care of the hard work.

The best way to work with java is to let the apis and the virtual machine worry with the optimization details and let the programmer focus on the creation of a nice algorithm.

Thanks for the response,

The current mixing of 3D and 2D (where Java3D gets to work in it’s canvas surrounded by other AWT components) actually works quite well. No performance issues as to how fast Java3D renders.

I would be ok with keeping it like this if I could find a way to get it to display properly in a fullscreen window.
But when I try to create a fullscreen window and then add a Canvas3D to it, it doesn’t render at all.

I therefore was looking at rendering into an offscreen buffer and display through an active rendering loop, this would also give us the benefit of being able to draw things on top of the 3D area.

There is not enough time or resources on this project to rewrite the entire application from scratch in full 3D, simulating any 2D components. Otherwise, I agree, that would have been the ideal choice.

Thanks for your views anyway, though.

Has anyone managed to get a decent framerate using the offscreen capabilities of a Canvas3D?

D

[quote]I would be ok with keeping it like this if I could find a way to get it to display properly in a fullscreen window.
But when I try to create a fullscreen window and then add a Canvas3D to it, it doesn’t render at all.
[/quote]
Weird. I’m currently using a JFrame for FullScreen mode with Canvas3D and I’m having no problems.

Steve

Hi
If you look at www.computerbooth.com under java3d there is an old full screen demo with a swing menu in it, all the code is there too. It needs a 1.4 vm and I think 1.3 java3d. I’ve not run it for months, but last time I checked it worked fine.

HTH

Endolf

Entering fullscreen mode in java3D is wicked easy, check my main framework here
You need this jar file in your class path though to access a cool screen mode selector.
Check this screenshot :slight_smile:

http://www.realityflux.com/abba/displaySettings.jpg

PS: Gotta modify that Xith3D logo sometime :stuck_out_tongue: