• Advertisement
Sign in to follow this  

[java] fullscreen problem with java3d

This topic is 4619 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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));
canvas.getScreen3D().setPhysicalScreenWidth(w);
canvas.getScreen3D().setPhysicalScreenHeight(h);
canvas.getScreen3D().setSize(w,h);
canvas.setOffScreenBuffer(buffer);

//Gets the screen buffer graphics
g = screen.getBufferGraphics();
	
//Do some 3d rendering...
canvas.renderOffScreenBuffer();
canvas.waitForOffScreenRendering();
			
//Moves the buffer
g.drawImage(buffer.getImage(),0,0,null);

//Shows the buffer
screen.getBufferStrategy().show();
			
//Frees more memory
g.dispose();


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
Advertisement
Umm... physical screen size means the monitor size...(I set it to pixel size).

Share this post


Link to post
Share on other sites
I don't play around with Java 3D, so I'll just guess... Can't it be done by the standard FSEM way?

Son Of Cain

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
Hi,

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

chris_j_pook(at)hotmail.com

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement