Sign in to follow this  

[java] fullscreen problem with java3d

Recommended Posts

Does anyone know how to get Java3D to work in fullscreen mode? I'm trying to get the Canvas3D to render to an offscreen buffer and then to display that to the screen. It kinda works (the white background color is applied as instructed by a Background object), but I think the frustrum must be getting screwed up or something, since the scene works when it is in a regular window. Here's what I'm doing.
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(new GraphicsConfigTemplate3D());
Canvas3D canvas   = new Canvas3D(gc,true);

//Sets up the buffer and canvas for offscreen buffering
buffer   = new ImageComponent2D(ImageComponent2D.FORMAT_RGBA,new BufferedImage(w,h,BufferedImage.TYPE_INT_ARGB));

//Gets the screen buffer graphics
g = screen.getBufferGraphics();
//Do some 3d rendering...
//Moves the buffer

//Shows the buffer
//Frees more memory

Any help or links that might be helpful would be well...helpful. [Edited by - mako_5 on June 27, 2005 7:11:28 PM]

Share this post

Link to post
Share on other sites
What's FSEM?

When you set the physical screen size do this...

//w & h are width and height in pixels
setSize(float w, float h)
width = 0.0254 / 90.0f * w
height = 0.0254 / 90.0f * h

That's how they determine the default values when the Canvas3D is created for onscreen rendering (you have to do it manually for offscreen rendering).

I tried LWJGL a little, but I think I didn't like it because of lack of documentation (it's there but not commented). It does have a lot of capabilities (and I was getting incredible FPS with lots of stuff on screen), but I decided Java3D to get into 3D programming, and I'm thinking also about going back to LWJGL later. Java3D has some real cool collision detection stuff, built in vectors & math, and not having to work with FloatBuffers is cool, but it just isn't as fast.

Share this post

Link to post
Share on other sites

Dont know if this is what your after but when I use Java3D full screen I use a ConfiguredUniverse along with a config file which defines the hardware you're using and allows full screen as well as stereo and such.

Email me and ill send you an example if this sounds like what your after


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this